3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
29 #define DL_IMPORT(t) t
32 #define DL_EXPORT(t) t
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
44 #define Py_HUGE_VAL HUGE_VAL
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
218 #define CYTHON_RESTRICT
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
226 # define CYTHON_UNUSED
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
250 #ifndef _MSC_STDINT_H_
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
276 #define CYTHON_FALLTHROUGH
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
287 #ifndef CYTHON_INLINE
288 #if defined(__clang__)
289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290 #elif defined(__GNUC__)
291 #define CYTHON_INLINE __inline__
292 #elif defined(_MSC_VER)
293 #define CYTHON_INLINE __inline
294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295 #define CYTHON_INLINE inline
297 #define CYTHON_INLINE
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302 #define Py_OptimizeFlag 0
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310 #define __Pyx_DefaultClassType PyClass_Type
312 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
320 #define __Pyx_DefaultClassType PyType_Type
322 #ifndef Py_TPFLAGS_CHECKTYPES
323 #define Py_TPFLAGS_CHECKTYPES 0
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326 #define Py_TPFLAGS_HAVE_INDEX 0
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332 #define Py_TPFLAGS_HAVE_FINALIZE 0
334 #ifndef METH_STACKLESS
335 #define METH_STACKLESS 0
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338 #ifndef METH_FASTCALL
339 #define METH_FASTCALL 0x80
341 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
342 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
343 Py_ssize_t nargs, PyObject *kwnames);
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast
346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
352 #define __Pyx_PyFastCFunction_Check(func) 0
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355 #define PyObject_Malloc(s) PyMem_Malloc(s)
356 #define PyObject_Free(p) PyMem_Free(p)
357 #define PyObject_Realloc(p) PyMem_Realloc(p)
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362 #define PyMem_RawFree(p) PyMem_Free(p)
364 #if CYTHON_COMPILING_IN_PYSTON
365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372 #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376 #define __Pyx_PyThreadState_Current PyThreadState_GET()
378 #define __Pyx_PyThreadState_Current _PyThreadState_Current
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
384 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
385 *key = PyThread_create_key();
388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
389 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
390 *key = Py_tss_NEEDS_INIT;
393 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
396 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
397 return *key != Py_tss_NEEDS_INIT;
399 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
400 PyThread_delete_key(*key);
401 *key = Py_tss_NEEDS_INIT;
403 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
404 return PyThread_set_key_value(*key, value);
406 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
407 return PyThread_get_key_value(*key);
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428 #define CYTHON_PEP393_ENABLED 1
429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430 0 : _PyUnicode_Ready((PyObject *)(op)))
431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
441 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
444 #define CYTHON_PEP393_ENABLED 0
445 #define PyUnicode_1BYTE_KIND 1
446 #define PyUnicode_2BYTE_KIND 2
447 #define PyUnicode_4BYTE_KIND 4
448 #define __Pyx_PyUnicode_READY(op) (0)
449 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
450 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
453 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
454 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
458 #if CYTHON_COMPILING_IN_PYPY
459 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
460 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
462 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
463 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
475 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
476 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
480 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483 #define PyObject_ASCII(o) PyObject_Repr(o)
485 #if PY_MAJOR_VERSION >= 3
486 #define PyBaseString_Type PyUnicode_Type
487 #define PyStringObject PyUnicodeObject
488 #define PyString_Type PyUnicode_Type
489 #define PyString_Check PyUnicode_Check
490 #define PyString_CheckExact PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492 #define PyObject_Unicode PyObject_Str
495 #if PY_MAJOR_VERSION >= 3
496 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
499 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
502 #ifndef PySet_CheckExact
503 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
505 #if PY_VERSION_HEX >= 0x030900A4
506 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
509 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
512 #if CYTHON_ASSUME_SAFE_MACROS
513 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
515 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
517 #if PY_MAJOR_VERSION >= 3
518 #define PyIntObject PyLongObject
519 #define PyInt_Type PyLong_Type
520 #define PyInt_Check(op) PyLong_Check(op)
521 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
522 #define PyInt_FromString PyLong_FromString
523 #define PyInt_FromUnicode PyLong_FromUnicode
524 #define PyInt_FromLong PyLong_FromLong
525 #define PyInt_FromSize_t PyLong_FromSize_t
526 #define PyInt_FromSsize_t PyLong_FromSsize_t
527 #define PyInt_AsLong PyLong_AsLong
528 #define PyInt_AS_LONG PyLong_AS_LONG
529 #define PyInt_AsSsize_t PyLong_AsSsize_t
530 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
531 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532 #define PyNumber_Int PyNumber_Long
534 #if PY_MAJOR_VERSION >= 3
535 #define PyBoolObject PyLongObject
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538 #ifndef PyUnicode_InternFromString
539 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
542 #if PY_VERSION_HEX < 0x030200A4
543 typedef long Py_hash_t;
544 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
547 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
550 #if PY_MAJOR_VERSION >= 3
551 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
553 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
555 #if CYTHON_USE_ASYNC_SLOTS
556 #if PY_VERSION_HEX >= 0x030500B1
557 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
560 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
563 #define __Pyx_PyType_AsAsync(obj) NULL
565 #ifndef __Pyx_PyAsyncMethodsStruct
570 } __Pyx_PyAsyncMethodsStruct;
573 #if defined(WIN32) || defined(MS_WINDOWS)
574 #define _USE_MATH_DEFINES
578 #define __PYX_NAN() ((float) NAN)
580 static CYTHON_INLINE
float __PYX_NAN() {
582 memset(&value, 0xFF,
sizeof(value));
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
589 #define __Pyx_truncl truncl
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
597 #ifndef __PYX_EXTERN_C
599 #define __PYX_EXTERN_C extern "C"
601 #define __PYX_EXTERN_C extern
605 #define __PYX_HAVE__subsurfaceTransportFunctions
606 #define __PYX_HAVE_API__subsurfaceTransportFunctions
610 #include "numpy/arrayobject.h"
611 #include "numpy/ufuncobject.h"
620 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
621 #define CYTHON_WITHOUT_ASSERTIONS
624 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
625 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
627 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
628 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
629 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
630 #define __PYX_DEFAULT_STRING_ENCODING ""
631 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
632 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
633 #define __Pyx_uchar_cast(c) ((unsigned char)c)
634 #define __Pyx_long_cast(x) ((long)x)
635 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
636 (sizeof(type) < sizeof(Py_ssize_t)) ||\
637 (sizeof(type) > sizeof(Py_ssize_t) &&\
638 likely(v < (type)PY_SSIZE_T_MAX ||\
639 v == (type)PY_SSIZE_T_MAX) &&\
640 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
641 v == (type)PY_SSIZE_T_MIN))) ||\
642 (sizeof(type) == sizeof(Py_ssize_t) &&\
643 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
644 v == (type)PY_SSIZE_T_MAX))) )
645 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
646 return (
size_t) i < (size_t) limit;
648 #if defined (__cplusplus) && __cplusplus >= 201103L
650 #define __Pyx_sst_abs(value) std::abs(value)
651 #elif SIZEOF_INT >= SIZEOF_SIZE_T
652 #define __Pyx_sst_abs(value) abs(value)
653 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
654 #define __Pyx_sst_abs(value) labs(value)
655 #elif defined (_MSC_VER)
656 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
657 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
658 #define __Pyx_sst_abs(value) llabs(value)
659 #elif defined (__GNUC__)
660 #define __Pyx_sst_abs(value) __builtin_llabs(value)
662 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
664 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
665 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
666 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
667 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
668 #define __Pyx_PyBytes_FromString PyBytes_FromString
669 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
670 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
671 #if PY_MAJOR_VERSION < 3
672 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
673 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
675 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
676 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
678 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
679 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
680 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
681 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
682 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
685 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
686 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
687 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
688 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
690 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
691 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
692 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
693 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
694 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
695 const Py_UNICODE *u_end =
u;
697 return (
size_t)(u_end -
u - 1);
699 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
700 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
701 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
702 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
703 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
704 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
705 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
706 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
707 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
708 #define __Pyx_PySequence_Tuple(obj)\
709 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
710 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
711 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
712 #if CYTHON_ASSUME_SAFE_MACROS
713 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
715 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
717 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
718 #if PY_MAJOR_VERSION >= 3
719 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
721 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
723 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
724 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
725 static int __Pyx_sys_getdefaultencoding_not_ascii;
726 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
728 PyObject* default_encoding = NULL;
729 PyObject* ascii_chars_u = NULL;
730 PyObject* ascii_chars_b = NULL;
731 const char* default_encoding_c;
732 sys = PyImport_ImportModule(
"sys");
734 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
736 if (!default_encoding)
goto bad;
737 default_encoding_c = PyBytes_AsString(default_encoding);
738 if (!default_encoding_c)
goto bad;
739 if (strcmp(default_encoding_c,
"ascii") == 0) {
740 __Pyx_sys_getdefaultencoding_not_ascii = 0;
742 char ascii_chars[128];
744 for (
c = 0;
c < 128;
c++) {
747 __Pyx_sys_getdefaultencoding_not_ascii = 1;
748 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
749 if (!ascii_chars_u)
goto bad;
750 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
751 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
754 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
758 Py_DECREF(ascii_chars_u);
759 Py_DECREF(ascii_chars_b);
761 Py_DECREF(default_encoding);
764 Py_XDECREF(default_encoding);
765 Py_XDECREF(ascii_chars_u);
766 Py_XDECREF(ascii_chars_b);
770 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
771 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
773 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
774 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
775 static char* __PYX_DEFAULT_STRING_ENCODING;
776 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
778 PyObject* default_encoding = NULL;
779 char* default_encoding_c;
780 sys = PyImport_ImportModule(
"sys");
782 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
784 if (!default_encoding)
goto bad;
785 default_encoding_c = PyBytes_AsString(default_encoding);
786 if (!default_encoding_c)
goto bad;
787 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
788 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
789 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
790 Py_DECREF(default_encoding);
793 Py_XDECREF(default_encoding);
801 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
802 #define likely(x) __builtin_expect(!!(x), 1)
803 #define unlikely(x) __builtin_expect(!!(x), 0)
805 #define likely(x) (x)
806 #define unlikely(x) (x)
808 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
810 static PyObject *__pyx_m = NULL;
811 static PyObject *__pyx_d;
812 static PyObject *__pyx_b;
813 static PyObject *__pyx_cython_runtime = NULL;
814 static PyObject *__pyx_empty_tuple;
815 static PyObject *__pyx_empty_bytes;
816 static PyObject *__pyx_empty_unicode;
817 static int __pyx_lineno;
818 static int __pyx_clineno = 0;
819 static const char * __pyx_cfilenm= __FILE__;
820 static const char *__pyx_filename;
823 #if !defined(CYTHON_CCOMPLEX)
824 #if defined(__cplusplus)
825 #define CYTHON_CCOMPLEX 1
826 #elif defined(_Complex_I)
827 #define CYTHON_CCOMPLEX 1
829 #define CYTHON_CCOMPLEX 0
839 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
841 #define _Complex_I 1.0fj
845 static const char *__pyx_f[] = {
846 "proteus/subsurfaceTransportFunctions.pyx",
851 #define IS_UNSIGNED(type) (((type) -1) > 0)
852 struct __Pyx_StructField_;
853 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
856 struct __Pyx_StructField_* fields;
864 typedef struct __Pyx_StructField_ {
865 __Pyx_TypeInfo* type;
870 __Pyx_StructField* field;
871 size_t parent_offset;
872 } __Pyx_BufFmt_StackElem;
874 __Pyx_StructField root;
875 __Pyx_BufFmt_StackElem* head;
877 size_t new_count, enc_count;
878 size_t struct_alignment;
884 } __Pyx_BufFmt_Context;
894 typedef npy_int8 __pyx_t_5numpy_int8_t;
903 typedef npy_int16 __pyx_t_5numpy_int16_t;
912 typedef npy_int32 __pyx_t_5numpy_int32_t;
921 typedef npy_int64 __pyx_t_5numpy_int64_t;
930 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
939 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
948 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
957 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
966 typedef npy_float32 __pyx_t_5numpy_float32_t;
975 typedef npy_float64 __pyx_t_5numpy_float64_t;
984 typedef npy_long __pyx_t_5numpy_int_t;
993 typedef npy_longlong __pyx_t_5numpy_long_t;
1002 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1011 typedef npy_ulong __pyx_t_5numpy_uint_t;
1020 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1029 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1038 typedef npy_intp __pyx_t_5numpy_intp_t;
1047 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1056 typedef npy_double __pyx_t_5numpy_float_t;
1065 typedef npy_double __pyx_t_5numpy_double_t;
1074 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1083 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
1092 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
1096 typedef ::std::complex< float > __pyx_t_float_complex;
1098 typedef float _Complex __pyx_t_float_complex;
1101 typedef struct {
float real, imag; } __pyx_t_float_complex;
1103 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1108 typedef ::std::complex< double > __pyx_t_double_complex;
1110 typedef double _Complex __pyx_t_double_complex;
1113 typedef struct {
double real, imag; } __pyx_t_double_complex;
1115 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1127 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1136 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1145 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1154 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1158 #ifndef CYTHON_REFNANNY
1159 #define CYTHON_REFNANNY 0
1163 void (*INCREF)(
void*, PyObject*, int);
1164 void (*DECREF)(
void*, PyObject*, int);
1165 void (*GOTREF)(
void*, PyObject*, int);
1166 void (*GIVEREF)(
void*, PyObject*, int);
1167 void* (*SetupContext)(
const char*, int,
const char*);
1168 void (*FinishContext)(
void**);
1169 } __Pyx_RefNannyAPIStruct;
1170 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1171 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1172 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1174 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1176 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1177 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1178 PyGILState_Release(__pyx_gilstate_save);\
1180 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1183 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1184 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1186 #define __Pyx_RefNannyFinishContext()\
1187 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1188 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1189 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1190 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1191 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1192 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1193 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1194 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1195 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1197 #define __Pyx_RefNannyDeclarations
1198 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1199 #define __Pyx_RefNannyFinishContext()
1200 #define __Pyx_INCREF(r) Py_INCREF(r)
1201 #define __Pyx_DECREF(r) Py_DECREF(r)
1202 #define __Pyx_GOTREF(r)
1203 #define __Pyx_GIVEREF(r)
1204 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1205 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1206 #define __Pyx_XGOTREF(r)
1207 #define __Pyx_XGIVEREF(r)
1209 #define __Pyx_XDECREF_SET(r, v) do {\
1210 PyObject *tmp = (PyObject *) r;\
1211 r = v; __Pyx_XDECREF(tmp);\
1213 #define __Pyx_DECREF_SET(r, v) do {\
1214 PyObject *tmp = (PyObject *) r;\
1215 r = v; __Pyx_DECREF(tmp);\
1217 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1218 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1221 #if CYTHON_USE_TYPE_SLOTS
1222 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1224 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1228 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1231 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1232 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1235 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1238 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1239 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1240 const char* function_name);
1243 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1244 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1245 __Pyx__ArgTypeTest(obj, type, name, exact))
1246 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1249 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1252 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1253 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1254 __Pyx_BufFmt_StackElem* stack,
1255 __Pyx_TypeInfo* type);
1258 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1259 ((obj == Py_None || obj == NULL) ?\
1260 (__Pyx_ZeroBuffer(buf), 0) :\
1261 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1262 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1263 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1264 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1265 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1266 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1267 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1270 static void __Pyx_RaiseBufferIndexError(
int axis);
1272 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1273 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
1275 #if CYTHON_FAST_THREAD_STATE
1276 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1277 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1278 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1280 #define __Pyx_PyThreadState_declare
1281 #define __Pyx_PyThreadState_assign
1282 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1286 #if CYTHON_FAST_THREAD_STATE
1287 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1288 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1289 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1290 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1291 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1292 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1293 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1294 #if CYTHON_COMPILING_IN_CPYTHON
1295 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1297 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1300 #define __Pyx_PyErr_Clear() PyErr_Clear()
1301 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1302 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1303 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1304 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1305 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1306 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1307 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1311 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1312 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1313 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1314 (likely(PyDict_CheckExact(obj)) ?\
1315 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1317 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1318 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1321 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
1323 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1324 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1325 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1326 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1327 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1328 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1329 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1330 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1331 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1332 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1333 int wraparound,
int boundscheck);
1334 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1335 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1336 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1337 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1338 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1339 int wraparound,
int boundscheck);
1340 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1341 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1342 int is_list,
int wraparound,
int boundscheck);
1345 #if CYTHON_USE_TYPE_SLOTS
1346 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1348 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1352 #if !CYTHON_COMPILING_IN_PYPY
1353 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1355 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
1356 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1359 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
1361 #if CYTHON_FAST_PYCALL
1362 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1363 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1364 #if 1 || PY_VERSION_HEX < 0x030600B1
1365 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1367 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1369 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1370 (sizeof(char [1 - 2*!(cond)]) - 1)
1371 #ifndef Py_MEMBER_SIZE
1372 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1374 static size_t __pyx_pyframe_localsplus_offset = 0;
1375 #include "frameobject.h"
1376 #define __Pxy_PyFrame_Initialize_Offsets()\
1377 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1378 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1379 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1380 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1384 #if CYTHON_FAST_PYCCALL
1385 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1387 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1391 #if CYTHON_COMPILING_IN_CPYTHON
1392 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1394 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1398 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1399 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1400 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1401 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1402 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1403 (cache_var) = (value);
1404 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1405 static PY_UINT64_T __pyx_dict_version = 0;\
1406 static PyObject *__pyx_dict_cached_value = NULL;\
1407 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1408 (VAR) = __pyx_dict_cached_value;\
1410 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1411 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1414 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1415 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1416 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1418 #define __PYX_GET_DICT_VERSION(dict) (0)
1419 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1420 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1424 #if CYTHON_USE_DICT_VERSIONS
1425 #define __Pyx_GetModuleGlobalName(var, name) {\
1426 static PY_UINT64_T __pyx_dict_version = 0;\
1427 static PyObject *__pyx_dict_cached_value = NULL;\
1428 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1429 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1430 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1432 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1433 PY_UINT64_T __pyx_dict_version;\
1434 PyObject *__pyx_dict_cached_value;\
1435 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1437 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1439 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1440 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1441 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1445 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1448 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1451 #if CYTHON_COMPILING_IN_CPYTHON
1452 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1456 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1459 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1460 #if CYTHON_COMPILING_IN_PYPY
1461 #define __Pyx_PyObject_AsDouble(obj)\
1462 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
1463 likely(PyInt_CheckExact(obj)) ?\
1464 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
1466 #define __Pyx_PyObject_AsDouble(obj)\
1467 ((likely(PyFloat_CheckExact(obj))) ?\
1468 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
1472 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1475 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1478 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1481 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1484 #if CYTHON_USE_EXC_INFO_STACK
1485 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1489 #if CYTHON_FAST_THREAD_STATE
1490 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1491 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1492 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1493 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1495 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1496 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1500 #if CYTHON_FAST_THREAD_STATE
1501 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1502 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1504 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1508 #if CYTHON_FAST_THREAD_STATE
1509 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1510 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1512 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1516 #ifndef __PYX_HAVE_RT_ImportType_proto
1517 #define __PYX_HAVE_RT_ImportType_proto
1518 enum __Pyx_ImportType_CheckSize {
1519 __Pyx_ImportType_CheckSize_Error = 0,
1520 __Pyx_ImportType_CheckSize_Warn = 1,
1521 __Pyx_ImportType_CheckSize_Ignore = 2
1523 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1527 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1530 #ifdef CYTHON_CLINE_IN_TRACEBACK
1531 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1533 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1538 PyCodeObject* code_object;
1540 } __Pyx_CodeObjectCacheEntry;
1541 struct __Pyx_CodeObjectCache {
1544 __Pyx_CodeObjectCacheEntry* entries;
1546 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1547 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1548 static PyCodeObject *__pyx_find_code_object(
int code_line);
1549 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1552 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1553 int py_line,
const char *filename);
1557 Py_ssize_t shape, strides, suboffsets;
1558 } __Pyx_Buf_DimInfo;
1564 __Pyx_Buffer *rcbuffer;
1566 __Pyx_Buf_DimInfo diminfo[8];
1567 } __Pyx_LocalBuf_ND;
1569 #if PY_MAJOR_VERSION < 3
1570 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1571 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1573 #define __Pyx_GetBuffer PyObject_GetBuffer
1574 #define __Pyx_ReleaseBuffer PyBuffer_Release
1579 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1582 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1585 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1590 #define __Pyx_CREAL(z) ((z).real())
1591 #define __Pyx_CIMAG(z) ((z).imag())
1593 #define __Pyx_CREAL(z) (__real__(z))
1594 #define __Pyx_CIMAG(z) (__imag__(z))
1597 #define __Pyx_CREAL(z) ((z).real)
1598 #define __Pyx_CIMAG(z) ((z).imag)
1600 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1601 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1602 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1603 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1605 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1606 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1611 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1612 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1613 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1614 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1615 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1616 #define __Pyx_c_neg_float(a) (-(a))
1618 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1619 #define __Pyx_c_conj_float(z) (::std::conj(z))
1621 #define __Pyx_c_abs_float(z) (::std::abs(z))
1622 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1625 #define __Pyx_c_is_zero_float(z) ((z)==0)
1626 #define __Pyx_c_conj_float(z) (conjf(z))
1628 #define __Pyx_c_abs_float(z) (cabsf(z))
1629 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1633 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1634 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1635 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1636 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1637 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1638 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1639 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1640 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1642 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1643 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1649 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1650 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1651 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1652 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1653 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1654 #define __Pyx_c_neg_double(a) (-(a))
1656 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1657 #define __Pyx_c_conj_double(z) (::std::conj(z))
1659 #define __Pyx_c_abs_double(z) (::std::abs(z))
1660 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1663 #define __Pyx_c_is_zero_double(z) ((z)==0)
1664 #define __Pyx_c_conj_double(z) (conj(z))
1666 #define __Pyx_c_abs_double(z) (cabs(z))
1667 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1671 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1672 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1673 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1674 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1675 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1676 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1677 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1678 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1680 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1681 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1686 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1689 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1692 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1695 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1698 #if CYTHON_COMPILING_IN_CPYTHON
1699 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1700 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1701 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1702 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1704 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1705 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1706 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1708 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1711 static int __Pyx_check_binary_version(
void);
1714 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1726 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1739 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1740 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1741 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1742 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1743 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1744 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1747 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1748 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1749 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
1750 extern int __pyx_module_is_main_subsurfaceTransportFunctions;
1751 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1754 static PyObject *__pyx_builtin_range;
1755 static PyObject *__pyx_builtin_RuntimeError;
1756 static PyObject *__pyx_builtin_ValueError;
1757 static PyObject *__pyx_builtin_ImportError;
1758 static const char __pyx_k_I[] =
"I";
1759 static const char __pyx_k_J[] =
"J";
1760 static const char __pyx_k_d[] =
"d";
1761 static const char __pyx_k_i[] =
"i";
1762 static const char __pyx_k_j[] =
"j";
1763 static const char __pyx_k_k[] =
"k";
1764 static const char __pyx_k_m[] =
"m";
1765 static const char __pyx_k_n[] =
"n";
1766 static const char __pyx_k_q[] =
"q";
1767 static const char __pyx_k_t[] =
"t";
1768 static const char __pyx_k_v[] =
"v";
1769 static const char __pyx_k_w[] =
"w";
1770 static const char __pyx_k_x[] =
"x";
1771 static const char __pyx_k_dS[] =
"dS";
1772 static const char __pyx_k_dV[] =
"dV";
1773 static const char __pyx_k_df[] =
"df";
1774 static const char __pyx_k_dm[] =
"dm";
1775 static const char __pyx_k_eN[] =
"eN";
1776 static const char __pyx_k_ii[] =
"ii";
1777 static const char __pyx_k_kb[] =
"kb";
1778 static const char __pyx_k_mt[] =
"mt";
1779 static const char __pyx_k_nd[] =
"nd";
1780 static const char __pyx_k_pi[] =
"pi";
1781 static const char __pyx_k_xc[] =
"xc";
1782 static const char __pyx_k_yc[] =
"yc";
1783 static const char __pyx_k_KWr[] =
"KWr";
1784 static const char __pyx_k_KWs[] =
"KWs";
1785 static const char __pyx_k_dmt[] =
"dmt";
1786 static const char __pyx_k_dot[] =
"dot";
1787 static const char __pyx_k_ebN[] =
"ebN";
1788 static const char __pyx_k_l2g[] =
"l2g";
1789 static const char __pyx_k_nnz[] =
"nnz";
1790 static const char __pyx_k_q_m[] =
"q_m";
1791 static const char __pyx_k_q_r[] =
"q_r";
1792 static const char __pyx_k_q_u[] =
"q_u";
1793 static const char __pyx_k_q_x[] =
"q_x";
1794 static const char __pyx_k_rho[] =
"rho";
1795 static const char __pyx_k_sum[] =
"sum";
1796 static const char __pyx_k_u_j[] =
"u_j";
1797 static const char __pyx_k_vol[] =
"vol";
1798 static const char __pyx_k_a_eN[] =
"a_eN";
1799 static const char __pyx_k_a_up[] =
"a_up";
1800 static const char __pyx_k_beta[] =
"beta";
1801 static const char __pyx_k_ebNE[] =
"ebNE";
1802 static const char __pyx_k_f_up[] =
"f_up";
1803 static const char __pyx_k_flat[] =
"flat";
1804 static const char __pyx_k_flux[] =
"flux";
1805 static const char __pyx_k_main[] =
"__main__";
1806 static const char __pyx_k_name[] =
"__name__";
1807 static const char __pyx_k_one8[] =
"one8";
1808 static const char __pyx_k_psiC[] =
"psiC";
1809 static const char __pyx_k_q_dm[] =
"q_dm";
1810 static const char __pyx_k_q_kr[] =
"q_kr";
1811 static const char __pyx_k_q_mt[] =
"q_mt";
1812 static const char __pyx_k_rho2[] =
"rho2";
1813 static const char __pyx_k_rhom[] =
"rhom";
1814 static const char __pyx_k_sBar[] =
"sBar";
1815 static const char __pyx_k_test[] =
"__test__";
1816 static const char __pyx_k_u_eN[] =
"u_eN";
1817 static const char __pyx_k_vBar[] =
"vBar";
1818 static const char __pyx_k_a_avg[] =
"a_avg";
1819 static const char __pyx_k_alpha[] =
"alpha";
1820 static const char __pyx_k_clock[] =
"clock";
1821 static const char __pyx_k_denom[] =
"denom";
1822 static const char __pyx_k_drhom[] =
"drhom";
1823 static const char __pyx_k_kr_eN[] =
"kr_eN";
1824 static const char __pyx_k_matID[] =
"matID";
1825 static const char __pyx_k_numer[] =
"numer";
1826 static const char __pyx_k_numpy[] =
"numpy";
1827 static const char __pyx_k_pcBar[] =
"pcBar";
1828 static const char __pyx_k_q_dkr[] =
"q_dkr";
1829 static const char __pyx_k_q_dmt[] =
"q_dmt";
1830 static const char __pyx_k_range[] =
"range";
1831 static const char __pyx_k_shape[] =
"shape";
1832 static const char __pyx_k_u_dof[] =
"u_dof";
1833 static const char __pyx_k_u_l2g[] =
"u_l2g";
1834 static const char __pyx_k_vBar2[] =
"vBar2";
1835 static const char __pyx_k_vol_e[] =
"vol_e";
1836 static const char __pyx_k_zeros[] =
"zeros";
1837 static const char __pyx_k_a_neig[] =
"a_neig";
1838 static const char __pyx_k_colind[] =
"colind";
1839 static const char __pyx_k_dkr_up[] =
"dkr_up";
1840 static const char __pyx_k_import[] =
"__import__";
1841 static const char __pyx_k_mt_avg[] =
"mt_avg";
1842 static const char __pyx_k_nSpace[] =
"nSpace";
1843 static const char __pyx_k_phi_eN[] =
"phi_eN";
1844 static const char __pyx_k_picard[] =
"picard";
1845 static const char __pyx_k_q_alin[] =
"q_alin";
1846 static const char __pyx_k_q_detJ[] =
"q_detJ";
1847 static const char __pyx_k_q_flin[] =
"q_flin";
1848 static const char __pyx_k_q_mass[] =
"q_mass";
1849 static const char __pyx_k_q_vals[] =
"q_vals";
1850 static const char __pyx_k_rowptr[] =
"rowptr";
1851 static const char __pyx_k_thetaR[] =
"thetaR";
1852 static const char __pyx_k_thetaS[] =
"thetaS";
1853 static const char __pyx_k_thetaW[] =
"thetaW";
1854 static const char __pyx_k_u_neig[] =
"u_neig";
1855 static const char __pyx_k_volume[] =
"volume";
1856 static const char __pyx_k_weight[] =
"weight";
1857 static const char __pyx_k_df_dofs[] =
"df_dofs";
1858 static const char __pyx_k_eN_left[] =
"eN_left";
1859 static const char __pyx_k_gravity[] =
"gravity";
1860 static const char __pyx_k_kr_neig[] =
"kr_neig";
1861 static const char __pyx_k_nSpace2[] =
"nSpace2";
1862 static const char __pyx_k_omega_e[] =
"omega_e";
1863 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1864 static const char __pyx_k_q_dmass[] =
"q_dmass";
1865 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1866 static const char __pyx_k_thetaSR[] =
"thetaSR";
1867 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1868 static const char __pyx_k_eN_right[] =
"eN_right";
1869 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1870 static const char __pyx_k_integral[] =
"integral";
1871 static const char __pyx_k_material[] =
"material";
1872 static const char __pyx_k_phi_neig[] =
"phi_neig";
1873 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1874 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1875 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1876 static const char __pyx_k_ebN_local[] =
"ebN_local";
1877 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1878 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1879 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1880 static const char __pyx_k_transient[] =
"transient";
1881 static const char __pyx_k_volFactor[] =
"volFactor";
1882 static const char __pyx_k_zVelocity[] =
"zVelocity";
1883 static const char __pyx_k_zvelocity[] =
"zvelocity";
1884 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1885 static const char __pyx_k_ValueError[] =
"ValueError";
1886 static const char __pyx_k_matID_neig[] =
"matID_neig";
1887 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1888 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1889 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1890 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1891 static const char __pyx_k_ImportError[] =
"ImportError";
1892 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1893 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1894 static const char __pyx_k_tForReversal[] =
"tForReversal";
1895 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1896 static const char __pyx_k_material_left[] =
"material_left";
1897 static const char __pyx_k_weak_residual[] =
"weak_residual";
1898 static const char __pyx_k_material_right[] =
"material_right";
1899 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1900 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1901 static const char __pyx_k_elementResidual[] =
"elementResidual";
1902 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1903 static const char __pyx_k_nElements_global[] =
"nElements_global";
1904 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1905 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1906 static const char __pyx_k_material_functions[] =
"material_functions";
1907 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1908 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1909 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1910 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1911 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1912 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1913 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1914 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1915 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1916 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1917 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1918 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1919 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1920 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1921 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1922 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1923 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1924 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1925 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1926 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1927 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1928 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1929 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1930 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1931 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1932 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1933 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1934 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1935 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1936 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1937 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1938 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1939 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1940 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1941 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1942 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1943 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1944 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1945 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1946 static const char __pyx_k_proteus_subsurfaceTransportFunct[] =
"proteus/subsurfaceTransportFunctions.pyx";
1947 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1948 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1949 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1950 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1951 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1952 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1953 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1954 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1955 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1956 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1957 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1958 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1959 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1960 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1961 static PyObject *__pyx_n_s_DKWr_DpsiC;
1962 static PyObject *__pyx_n_s_DsBar_DpsiC;
1963 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1964 static PyObject *__pyx_n_s_DvBar_DpsiC;
1965 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1966 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1967 static PyObject *__pyx_n_s_I;
1968 static PyObject *__pyx_n_s_ImportError;
1969 static PyObject *__pyx_n_s_J;
1970 static PyObject *__pyx_n_s_KWr;
1971 static PyObject *__pyx_n_s_KWs;
1972 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1973 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1974 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1975 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1976 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1977 static PyObject *__pyx_n_s_RuntimeError;
1978 static PyObject *__pyx_n_s_ValueError;
1979 static PyObject *__pyx_n_s_a_avg;
1980 static PyObject *__pyx_n_s_a_eN;
1981 static PyObject *__pyx_n_s_a_neig;
1982 static PyObject *__pyx_n_s_a_up;
1983 static PyObject *__pyx_n_s_alpha;
1984 static PyObject *__pyx_n_s_beta;
1985 static PyObject *__pyx_n_s_calculateNormalFlux;
1986 static PyObject *__pyx_n_s_characteristic_velocity;
1987 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1988 static PyObject *__pyx_n_s_cline_in_traceback;
1989 static PyObject *__pyx_n_s_clock;
1990 static PyObject *__pyx_n_s_colind;
1991 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1992 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1993 static PyObject *__pyx_n_s_d;
1994 static PyObject *__pyx_n_s_dS;
1995 static PyObject *__pyx_n_s_dV;
1996 static PyObject *__pyx_n_s_denom;
1997 static PyObject *__pyx_n_s_df;
1998 static PyObject *__pyx_n_s_df_dofs;
1999 static PyObject *__pyx_n_s_dkr_up;
2000 static PyObject *__pyx_n_s_dm;
2001 static PyObject *__pyx_n_s_dmt;
2002 static PyObject *__pyx_n_s_dmtj_avg;
2003 static PyObject *__pyx_n_s_dot;
2004 static PyObject *__pyx_n_s_drhom;
2005 static PyObject *__pyx_n_s_eN;
2006 static PyObject *__pyx_n_s_eN_left;
2007 static PyObject *__pyx_n_s_eN_neighbor;
2008 static PyObject *__pyx_n_s_eN_right;
2009 static PyObject *__pyx_n_s_ebN;
2010 static PyObject *__pyx_n_s_ebNE;
2011 static PyObject *__pyx_n_s_ebN_local;
2012 static PyObject *__pyx_n_s_ebq_global_vals;
2013 static PyObject *__pyx_n_s_ebq_vals;
2014 static PyObject *__pyx_n_s_elementBarycentersArray;
2015 static PyObject *__pyx_n_s_elementBoundariesArray;
2016 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
2017 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2018 static PyObject *__pyx_n_s_elementBoundaryTypes;
2019 static PyObject *__pyx_n_s_elementJacobian;
2020 static PyObject *__pyx_n_s_elementMaterialTypes;
2021 static PyObject *__pyx_n_s_elementNeighborsArray;
2022 static PyObject *__pyx_n_s_elementResidual;
2023 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
2024 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
2025 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
2026 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
2027 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
2028 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
2029 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2030 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
2031 static PyObject *__pyx_n_s_f_up;
2032 static PyObject *__pyx_n_s_flat;
2033 static PyObject *__pyx_n_s_flux;
2034 static PyObject *__pyx_n_s_gravity;
2035 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
2036 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
2037 static PyObject *__pyx_n_s_i;
2038 static PyObject *__pyx_n_s_ii;
2039 static PyObject *__pyx_n_s_import;
2040 static PyObject *__pyx_n_s_integral;
2041 static PyObject *__pyx_n_s_j;
2042 static PyObject *__pyx_n_s_jacobian_weak_residual;
2043 static PyObject *__pyx_n_s_k;
2044 static PyObject *__pyx_n_s_kb;
2045 static PyObject *__pyx_n_s_kr_eN;
2046 static PyObject *__pyx_n_s_kr_neig;
2047 static PyObject *__pyx_n_s_l2g;
2048 static PyObject *__pyx_n_s_m;
2049 static PyObject *__pyx_n_s_main;
2050 static PyObject *__pyx_n_s_matID;
2051 static PyObject *__pyx_n_s_matID_neig;
2052 static PyObject *__pyx_n_s_material;
2053 static PyObject *__pyx_n_s_material_functions;
2054 static PyObject *__pyx_n_s_material_left;
2055 static PyObject *__pyx_n_s_material_right;
2056 static PyObject *__pyx_n_s_mt;
2057 static PyObject *__pyx_n_s_mt_avg;
2058 static PyObject *__pyx_n_s_n;
2059 static PyObject *__pyx_n_s_nAvgWeight;
2060 static PyObject *__pyx_n_s_nDOF_test_element;
2061 static PyObject *__pyx_n_s_nDOF_trial_element;
2062 static PyObject *__pyx_n_s_nElementBoundaries_element;
2063 static PyObject *__pyx_n_s_nElementBoundaries_global;
2064 static PyObject *__pyx_n_s_nElements_global;
2065 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
2066 static PyObject *__pyx_n_s_nSpace;
2067 static PyObject *__pyx_n_s_nSpace2;
2068 static PyObject *__pyx_n_s_name;
2069 static PyObject *__pyx_n_s_nd;
2070 static PyObject *__pyx_n_s_nnz;
2071 static PyObject *__pyx_n_s_numer;
2072 static PyObject *__pyx_n_s_numpy;
2073 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2074 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2075 static PyObject *__pyx_n_s_omega_e;
2076 static PyObject *__pyx_n_s_one8;
2077 static PyObject *__pyx_n_s_onePlus_pcBar_n;
2078 static PyObject *__pyx_n_s_pcBar;
2079 static PyObject *__pyx_n_s_pcBar_n;
2080 static PyObject *__pyx_n_s_pcBar_nM1;
2081 static PyObject *__pyx_n_s_pcBar_nM2;
2082 static PyObject *__pyx_n_s_phi_eN;
2083 static PyObject *__pyx_n_s_phi_neig;
2084 static PyObject *__pyx_n_s_pi;
2085 static PyObject *__pyx_n_s_picard;
2086 static PyObject *__pyx_kp_s_proteus_subsurfaceTransportFunct;
2087 static PyObject *__pyx_n_s_psiC;
2088 static PyObject *__pyx_n_s_q;
2089 static PyObject *__pyx_n_s_q_alin;
2090 static PyObject *__pyx_n_s_q_detJ;
2091 static PyObject *__pyx_n_s_q_dkr;
2092 static PyObject *__pyx_n_s_q_dm;
2093 static PyObject *__pyx_n_s_q_dmass;
2094 static PyObject *__pyx_n_s_q_dmt;
2095 static PyObject *__pyx_n_s_q_flin;
2096 static PyObject *__pyx_n_s_q_grad_u;
2097 static PyObject *__pyx_n_s_q_grad_v;
2098 static PyObject *__pyx_n_s_q_grad_w;
2099 static PyObject *__pyx_n_s_q_kr;
2100 static PyObject *__pyx_n_s_q_kr_up;
2101 static PyObject *__pyx_n_s_q_m;
2102 static PyObject *__pyx_n_s_q_mass;
2103 static PyObject *__pyx_n_s_q_mt;
2104 static PyObject *__pyx_n_s_q_r;
2105 static PyObject *__pyx_n_s_q_u;
2106 static PyObject *__pyx_n_s_q_vals;
2107 static PyObject *__pyx_n_s_q_x;
2108 static PyObject *__pyx_n_s_range;
2109 static PyObject *__pyx_n_s_rho;
2110 static PyObject *__pyx_n_s_rho2;
2111 static PyObject *__pyx_n_s_rhom;
2112 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
2113 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
2114 static PyObject *__pyx_n_s_rowptr;
2115 static PyObject *__pyx_n_s_sBar;
2116 static PyObject *__pyx_n_s_setElementBoundariesArray;
2117 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
2118 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
2119 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
2120 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
2121 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
2122 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
2123 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
2124 static PyObject *__pyx_n_s_shape;
2125 static PyObject *__pyx_n_s_sqrt_sBar;
2126 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
2127 static PyObject *__pyx_n_s_sum;
2128 static PyObject *__pyx_n_s_t;
2129 static PyObject *__pyx_n_s_tForReversal;
2130 static PyObject *__pyx_n_s_test;
2131 static PyObject *__pyx_n_s_thetaR;
2132 static PyObject *__pyx_n_s_thetaS;
2133 static PyObject *__pyx_n_s_thetaSR;
2134 static PyObject *__pyx_n_s_thetaW;
2135 static PyObject *__pyx_n_s_thisElementIsUpwind;
2136 static PyObject *__pyx_n_s_transient;
2137 static PyObject *__pyx_n_s_u_dof;
2138 static PyObject *__pyx_n_s_u_eN;
2139 static PyObject *__pyx_n_s_u_j;
2140 static PyObject *__pyx_n_s_u_l2g;
2141 static PyObject *__pyx_n_s_u_neig;
2142 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2143 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
2144 static PyObject *__pyx_n_s_updateMass_weakAvg;
2145 static PyObject *__pyx_n_s_upwindFlag;
2146 static PyObject *__pyx_n_s_v;
2147 static PyObject *__pyx_n_s_vBar;
2148 static PyObject *__pyx_n_s_vBar2;
2149 static PyObject *__pyx_n_s_vol;
2150 static PyObject *__pyx_n_s_volFactor;
2151 static PyObject *__pyx_n_s_vol_e;
2152 static PyObject *__pyx_n_s_volume;
2153 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
2154 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
2155 static PyObject *__pyx_n_s_w;
2156 static PyObject *__pyx_n_s_weak_residual;
2157 static PyObject *__pyx_n_s_weight;
2158 static PyObject *__pyx_n_s_x;
2159 static PyObject *__pyx_n_s_xc;
2160 static PyObject *__pyx_n_s_yc;
2161 static PyObject *__pyx_n_s_zVelocity;
2162 static PyObject *__pyx_n_s_zeros;
2163 static PyObject *__pyx_n_s_zvelocity;
2164 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
2165 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
2166 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2167 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2168 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2169 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2170 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2171 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2172 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2173 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
2174 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2175 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
2176 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2177 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
2178 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
2179 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
2180 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
2181 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
2182 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
2183 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
2184 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
2185 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2186 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
2187 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2188 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
2189 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2190 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2191 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2192 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
2193 static PyObject *__pyx_float_0_0;
2194 static PyObject *__pyx_float_0_5;
2195 static PyObject *__pyx_float_2_0;
2196 static PyObject *__pyx_float_1_0eneg_20;
2197 static PyObject *__pyx_slice_;
2198 static PyObject *__pyx_tuple__2;
2199 static PyObject *__pyx_tuple__3;
2200 static PyObject *__pyx_tuple__4;
2201 static PyObject *__pyx_tuple__5;
2202 static PyObject *__pyx_tuple__6;
2203 static PyObject *__pyx_tuple__7;
2204 static PyObject *__pyx_tuple__9;
2205 static PyObject *__pyx_tuple__11;
2206 static PyObject *__pyx_tuple__13;
2207 static PyObject *__pyx_tuple__15;
2208 static PyObject *__pyx_tuple__17;
2209 static PyObject *__pyx_tuple__19;
2210 static PyObject *__pyx_tuple__21;
2211 static PyObject *__pyx_tuple__23;
2212 static PyObject *__pyx_tuple__25;
2213 static PyObject *__pyx_tuple__27;
2214 static PyObject *__pyx_tuple__29;
2215 static PyObject *__pyx_tuple__31;
2216 static PyObject *__pyx_tuple__33;
2217 static PyObject *__pyx_tuple__35;
2218 static PyObject *__pyx_tuple__37;
2219 static PyObject *__pyx_tuple__39;
2220 static PyObject *__pyx_tuple__41;
2221 static PyObject *__pyx_tuple__43;
2222 static PyObject *__pyx_tuple__45;
2223 static PyObject *__pyx_tuple__47;
2224 static PyObject *__pyx_tuple__49;
2225 static PyObject *__pyx_tuple__51;
2226 static PyObject *__pyx_tuple__53;
2227 static PyObject *__pyx_tuple__55;
2228 static PyObject *__pyx_tuple__57;
2229 static PyObject *__pyx_tuple__59;
2230 static PyObject *__pyx_tuple__61;
2231 static PyObject *__pyx_tuple__63;
2232 static PyObject *__pyx_codeobj__8;
2233 static PyObject *__pyx_codeobj__10;
2234 static PyObject *__pyx_codeobj__12;
2235 static PyObject *__pyx_codeobj__14;
2236 static PyObject *__pyx_codeobj__16;
2237 static PyObject *__pyx_codeobj__18;
2238 static PyObject *__pyx_codeobj__20;
2239 static PyObject *__pyx_codeobj__22;
2240 static PyObject *__pyx_codeobj__24;
2241 static PyObject *__pyx_codeobj__26;
2242 static PyObject *__pyx_codeobj__28;
2243 static PyObject *__pyx_codeobj__30;
2244 static PyObject *__pyx_codeobj__32;
2245 static PyObject *__pyx_codeobj__34;
2246 static PyObject *__pyx_codeobj__36;
2247 static PyObject *__pyx_codeobj__38;
2248 static PyObject *__pyx_codeobj__40;
2249 static PyObject *__pyx_codeobj__42;
2250 static PyObject *__pyx_codeobj__44;
2251 static PyObject *__pyx_codeobj__46;
2252 static PyObject *__pyx_codeobj__48;
2253 static PyObject *__pyx_codeobj__50;
2254 static PyObject *__pyx_codeobj__52;
2255 static PyObject *__pyx_codeobj__54;
2256 static PyObject *__pyx_codeobj__56;
2257 static PyObject *__pyx_codeobj__58;
2258 static PyObject *__pyx_codeobj__60;
2259 static PyObject *__pyx_codeobj__62;
2260 static PyObject *__pyx_codeobj__64;
2271 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2273 __Pyx_RefNannyDeclarations
2275 __Pyx_RefNannySetupContext(
"double_max", 0);
2276 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2277 __pyx_t_1 = __pyx_v_a;
2279 __pyx_t_1 = __pyx_v_b;
2281 __pyx_r = __pyx_t_1;
2286 __Pyx_RefNannyFinishContext();
2298 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2300 __Pyx_RefNannyDeclarations
2302 __Pyx_RefNannySetupContext(
"double_min", 0);
2303 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2304 __pyx_t_1 = __pyx_v_a;
2306 __pyx_t_1 = __pyx_v_b;
2308 __pyx_r = __pyx_t_1;
2313 __Pyx_RefNannyFinishContext();
2326 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2327 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2328 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2329 int __pyx_v_nExteriorElementBoundaries_global;
2330 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2331 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2332 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2333 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2334 int __pyx_lineno = 0;
2335 const char *__pyx_filename = NULL;
2336 int __pyx_clineno = 0;
2337 PyObject *__pyx_r = 0;
2338 __Pyx_RefNannyDeclarations
2339 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2341 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2342 PyObject* values[5] = {0,0,0,0,0};
2343 if (unlikely(__pyx_kwds)) {
2345 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2347 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2349 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2351 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2353 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2355 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2358 default:
goto __pyx_L5_argtuple_error;
2360 kw_args = PyDict_Size(__pyx_kwds);
2363 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2364 else goto __pyx_L5_argtuple_error;
2367 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2369 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2373 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2375 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2379 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2381 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2385 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2387 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2390 if (unlikely(kw_args > 0)) {
2391 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2393 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2394 goto __pyx_L5_argtuple_error;
2396 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2397 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2398 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2399 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2400 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2402 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2403 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2404 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2405 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2406 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2408 goto __pyx_L4_argument_unpacking_done;
2409 __pyx_L5_argtuple_error:;
2410 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2412 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2413 __Pyx_RefNannyFinishContext();
2415 __pyx_L4_argument_unpacking_done:;
2416 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2417 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2418 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2419 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2420 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2427 __Pyx_RefNannyFinishContext();
2431 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2435 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2436 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2437 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2438 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2439 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2440 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2441 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2442 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2443 PyObject *__pyx_r = NULL;
2444 __Pyx_RefNannyDeclarations
2448 Py_ssize_t __pyx_t_4;
2450 Py_ssize_t __pyx_t_6;
2451 int __pyx_lineno = 0;
2452 const char *__pyx_filename = NULL;
2453 int __pyx_clineno = 0;
2454 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2455 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2456 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2457 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2458 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2459 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2460 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2461 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2462 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2463 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2464 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2465 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2466 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2467 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2468 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2469 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2470 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2472 __Pyx_BufFmt_StackElem __pyx_stack[1];
2473 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2475 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2477 __Pyx_BufFmt_StackElem __pyx_stack[1];
2478 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2480 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2482 __Pyx_BufFmt_StackElem __pyx_stack[1];
2483 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2485 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2487 __Pyx_BufFmt_StackElem __pyx_stack[1];
2488 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2490 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2499 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2500 __pyx_t_2 = __pyx_t_1;
2501 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2502 __pyx_v_ebNE = __pyx_t_3;
2511 __pyx_t_4 = __pyx_v_ebNE;
2513 if (__pyx_t_4 < 0) {
2514 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2515 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2516 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_5 = 0;
2517 if (unlikely(__pyx_t_5 != -1)) {
2518 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2519 __PYX_ERR(0, 25, __pyx_L1_error)
2521 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2530 __pyx_t_4 = __pyx_v_ebN;
2533 if (__pyx_t_4 < 0) {
2534 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2535 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2536 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2537 if (__pyx_t_6 < 0) {
2538 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2539 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 1;
2540 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2541 if (unlikely(__pyx_t_5 != -1)) {
2542 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2543 __PYX_ERR(0, 26, __pyx_L1_error)
2545 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2554 __pyx_t_6 = __pyx_v_eN;
2556 if (__pyx_t_6 < 0) {
2557 __pyx_t_6 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2558 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2559 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2560 if (unlikely(__pyx_t_5 != -1)) {
2561 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2562 __PYX_ERR(0, 27, __pyx_L1_error)
2564 __pyx_t_4 = __pyx_v_ebNE;
2566 if (__pyx_t_4 < 0) {
2567 __pyx_t_4 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2568 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2569 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2570 if (unlikely(__pyx_t_5 != -1)) {
2571 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2572 __PYX_ERR(0, 27, __pyx_L1_error)
2574 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2589 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2590 __Pyx_PyThreadState_declare
2591 __Pyx_PyThreadState_assign
2592 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2593 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2595 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2597 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2598 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2603 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2604 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2607 __Pyx_XGIVEREF(__pyx_r);
2608 __Pyx_RefNannyFinishContext();
2621 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2622 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2623 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2624 int __pyx_v_nElementBoundaries_global;
2625 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2626 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2627 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2628 int __pyx_lineno = 0;
2629 const char *__pyx_filename = NULL;
2630 int __pyx_clineno = 0;
2631 PyObject *__pyx_r = 0;
2632 __Pyx_RefNannyDeclarations
2633 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2635 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2636 PyObject* values[4] = {0,0,0,0};
2637 if (unlikely(__pyx_kwds)) {
2639 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2641 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2643 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2645 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2647 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2650 default:
goto __pyx_L5_argtuple_error;
2652 kw_args = PyDict_Size(__pyx_kwds);
2655 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2656 else goto __pyx_L5_argtuple_error;
2659 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2661 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2665 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2667 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2671 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2673 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2676 if (unlikely(kw_args > 0)) {
2677 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2679 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2680 goto __pyx_L5_argtuple_error;
2682 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2683 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2684 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2685 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2687 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2688 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2689 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2690 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2692 goto __pyx_L4_argument_unpacking_done;
2693 __pyx_L5_argtuple_error:;
2694 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2696 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2697 __Pyx_RefNannyFinishContext();
2699 __pyx_L4_argument_unpacking_done:;
2700 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2701 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2702 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2703 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2710 __Pyx_RefNannyFinishContext();
2714 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2716 int __pyx_v_eN_left;
2717 int __pyx_v_eN_right;
2718 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2719 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2720 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2721 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2722 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2723 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2724 PyObject *__pyx_r = NULL;
2725 __Pyx_RefNannyDeclarations
2729 Py_ssize_t __pyx_t_4;
2730 Py_ssize_t __pyx_t_5;
2732 Py_ssize_t __pyx_t_7;
2734 int __pyx_lineno = 0;
2735 const char *__pyx_filename = NULL;
2736 int __pyx_clineno = 0;
2737 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2738 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2739 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2740 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2741 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2742 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2743 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2744 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2745 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2746 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2747 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2748 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2749 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2751 __Pyx_BufFmt_StackElem __pyx_stack[1];
2752 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2754 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2756 __Pyx_BufFmt_StackElem __pyx_stack[1];
2757 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2759 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2761 __Pyx_BufFmt_StackElem __pyx_stack[1];
2762 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2764 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2773 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2774 __pyx_t_2 = __pyx_t_1;
2775 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2776 __pyx_v_ebN = __pyx_t_3;
2785 __pyx_t_4 = __pyx_v_ebN;
2788 if (__pyx_t_4 < 0) {
2789 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2790 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2791 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2792 if (__pyx_t_5 < 0) {
2793 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2794 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2795 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2796 if (unlikely(__pyx_t_6 != -1)) {
2797 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2798 __PYX_ERR(0, 35, __pyx_L1_error)
2800 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2809 __pyx_t_5 = __pyx_v_ebN;
2812 if (__pyx_t_5 < 0) {
2813 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2814 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2815 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_6 = 0;
2816 if (__pyx_t_4 < 0) {
2817 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2818 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
2819 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_6 = 1;
2820 if (unlikely(__pyx_t_6 != -1)) {
2821 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2822 __PYX_ERR(0, 36, __pyx_L1_error)
2824 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2833 __pyx_t_4 = __pyx_v_eN_left;
2835 if (__pyx_t_4 < 0) {
2836 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2837 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2838 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2839 if (unlikely(__pyx_t_6 != -1)) {
2840 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2841 __PYX_ERR(0, 37, __pyx_L1_error)
2843 __pyx_t_5 = __pyx_v_ebN;
2846 if (__pyx_t_5 < 0) {
2847 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2848 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2849 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2850 if (__pyx_t_7 < 0) {
2851 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2852 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
2853 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2854 if (unlikely(__pyx_t_6 != -1)) {
2855 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2856 __PYX_ERR(0, 37, __pyx_L1_error)
2858 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2867 __pyx_t_4 = __pyx_v_eN_left;
2869 if (__pyx_t_4 < 0) {
2870 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2871 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2872 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2873 if (unlikely(__pyx_t_6 != -1)) {
2874 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2875 __PYX_ERR(0, 38, __pyx_L1_error)
2877 __pyx_t_7 = __pyx_v_ebN;
2880 if (__pyx_t_7 < 0) {
2881 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2882 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 0;
2883 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2884 if (__pyx_t_5 < 0) {
2885 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2886 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
2887 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2888 if (unlikely(__pyx_t_6 != -1)) {
2889 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2890 __PYX_ERR(0, 38, __pyx_L1_error)
2892 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2901 __pyx_t_8 = ((__pyx_v_eN_right >= 0) != 0);
2911 __pyx_t_4 = __pyx_v_eN_right;
2913 if (__pyx_t_4 < 0) {
2914 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2915 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
2916 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2917 if (unlikely(__pyx_t_6 != -1)) {
2918 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2919 __PYX_ERR(0, 40, __pyx_L1_error)
2921 __pyx_t_5 = __pyx_v_ebN;
2924 if (__pyx_t_5 < 0) {
2925 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2926 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
2927 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_6 = 0;
2928 if (__pyx_t_7 < 0) {
2929 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2930 if (unlikely(__pyx_t_7 < 0)) __pyx_t_6 = 1;
2931 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_6 = 1;
2932 if (unlikely(__pyx_t_6 != -1)) {
2933 __Pyx_RaiseBufferIndexError(__pyx_t_6);
2934 __PYX_ERR(0, 40, __pyx_L1_error)
2936 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2957 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2960 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2961 __Pyx_PyThreadState_declare
2962 __Pyx_PyThreadState_assign
2963 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2964 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2965 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2966 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2967 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2968 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2972 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2973 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2974 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2976 __Pyx_XGIVEREF(__pyx_r);
2977 __Pyx_RefNannyFinishContext();
2990 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2991 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2992 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2993 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2994 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2995 PyArrayObject *__pyx_v_q_vals = 0;
2996 PyObject *__pyx_v_material_functions = 0;
2997 int __pyx_lineno = 0;
2998 const char *__pyx_filename = NULL;
2999 int __pyx_clineno = 0;
3000 PyObject *__pyx_r = 0;
3001 __Pyx_RefNannyDeclarations
3002 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
3004 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3005 PyObject* values[3] = {0,0,0};
3006 if (unlikely(__pyx_kwds)) {
3008 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3010 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3012 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3014 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3017 default:
goto __pyx_L5_argtuple_error;
3019 kw_args = PyDict_Size(__pyx_kwds);
3022 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3023 else goto __pyx_L5_argtuple_error;
3026 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3028 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
3032 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3034 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
3037 if (unlikely(kw_args > 0)) {
3038 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
3040 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3041 goto __pyx_L5_argtuple_error;
3043 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3044 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3045 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3047 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3048 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3049 __pyx_v_material_functions = ((PyObject*)values[2]);
3051 goto __pyx_L4_argument_unpacking_done;
3052 __pyx_L5_argtuple_error:;
3053 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
3055 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3056 __Pyx_RefNannyFinishContext();
3058 __pyx_L4_argument_unpacking_done:;
3059 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
3060 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
3061 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
3062 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3069 __Pyx_RefNannyFinishContext();
3073 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3076 int __pyx_v_material;
3077 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3078 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3079 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3080 __Pyx_Buffer __pyx_pybuffer_q_vals;
3081 PyObject *__pyx_r = NULL;
3082 __Pyx_RefNannyDeclarations
3086 Py_ssize_t __pyx_t_4;
3090 PyObject *__pyx_t_8 = NULL;
3091 PyObject *__pyx_t_9 = NULL;
3092 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_10;
3093 Py_ssize_t __pyx_t_11;
3095 int __pyx_lineno = 0;
3096 const char *__pyx_filename = NULL;
3097 int __pyx_clineno = 0;
3098 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
3099 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3100 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3101 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3102 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3103 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3104 __pyx_pybuffer_q_vals.refcount = 0;
3105 __pyx_pybuffernd_q_vals.data = NULL;
3106 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3108 __Pyx_BufFmt_StackElem __pyx_stack[1];
3109 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3111 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3113 __Pyx_BufFmt_StackElem __pyx_stack[1];
3114 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
3116 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
3125 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3126 __pyx_t_2 = __pyx_t_1;
3127 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3128 __pyx_v_eN = __pyx_t_3;
3137 __pyx_t_4 = __pyx_v_eN;
3139 if (__pyx_t_4 < 0) {
3140 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3141 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3142 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3143 if (unlikely(__pyx_t_5 != -1)) {
3144 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3145 __PYX_ERR(0, 52, __pyx_L1_error)
3147 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3156 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3157 __pyx_t_7 = __pyx_t_6;
3158 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3159 __pyx_v_k = __pyx_t_5;
3168 if (unlikely(__pyx_v_material_functions == Py_None)) {
3169 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3170 __PYX_ERR(0, 54, __pyx_L1_error)
3172 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
3173 __Pyx_GOTREF(__pyx_t_8);
3174 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
3175 __Pyx_GOTREF(__pyx_t_9);
3176 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3177 __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9);
if (unlikely((__pyx_t_10 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
3178 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3179 __pyx_t_4 = __pyx_v_eN;
3180 __pyx_t_11 = __pyx_v_k;
3182 if (__pyx_t_4 < 0) {
3183 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
3184 if (unlikely(__pyx_t_4 < 0)) __pyx_t_12 = 0;
3185 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_12 = 0;
3186 if (__pyx_t_11 < 0) {
3187 __pyx_t_11 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
3188 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 1;
3189 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_12 = 1;
3190 if (unlikely(__pyx_t_12 != -1)) {
3191 __Pyx_RaiseBufferIndexError(__pyx_t_12);
3192 __PYX_ERR(0, 54, __pyx_L1_error)
3194 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_10;
3207 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3210 __Pyx_XDECREF(__pyx_t_8);
3211 __Pyx_XDECREF(__pyx_t_9);
3212 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3213 __Pyx_PyThreadState_declare
3214 __Pyx_PyThreadState_assign
3215 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3216 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3217 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3218 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3219 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3223 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3224 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3226 __Pyx_XGIVEREF(__pyx_r);
3227 __Pyx_RefNannyFinishContext();
3240 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3241 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
3242 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
3243 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3244 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
3245 PyArrayObject *__pyx_v_q_vals = 0;
3246 PyObject *__pyx_v_material_functions = 0;
3247 int __pyx_lineno = 0;
3248 const char *__pyx_filename = NULL;
3249 int __pyx_clineno = 0;
3250 PyObject *__pyx_r = 0;
3251 __Pyx_RefNannyDeclarations
3252 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
3254 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
3255 PyObject* values[3] = {0,0,0};
3256 if (unlikely(__pyx_kwds)) {
3258 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3260 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3262 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3264 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3267 default:
goto __pyx_L5_argtuple_error;
3269 kw_args = PyDict_Size(__pyx_kwds);
3272 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
3273 else goto __pyx_L5_argtuple_error;
3276 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
3278 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
3282 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3284 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
3287 if (unlikely(kw_args > 0)) {
3288 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
3290 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3291 goto __pyx_L5_argtuple_error;
3293 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3294 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3295 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3297 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
3298 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
3299 __pyx_v_material_functions = ((PyObject*)values[2]);
3301 goto __pyx_L4_argument_unpacking_done;
3302 __pyx_L5_argtuple_error:;
3303 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
3305 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3306 __Pyx_RefNannyFinishContext();
3308 __pyx_L4_argument_unpacking_done:;
3309 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
3310 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3311 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3312 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3319 __Pyx_RefNannyFinishContext();
3323 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3326 int __pyx_v_material;
3327 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3328 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3329 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3330 __Pyx_Buffer __pyx_pybuffer_q_vals;
3331 PyObject *__pyx_r = NULL;
3332 __Pyx_RefNannyDeclarations
3336 Py_ssize_t __pyx_t_4;
3340 PyObject *__pyx_t_8 = NULL;
3341 PyObject *__pyx_t_9 = NULL;
3342 PyObject *__pyx_t_10 = NULL;
3343 PyObject *__pyx_t_11 = NULL;
3344 int __pyx_lineno = 0;
3345 const char *__pyx_filename = NULL;
3346 int __pyx_clineno = 0;
3347 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3348 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3349 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3350 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3351 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3352 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3353 __pyx_pybuffer_q_vals.refcount = 0;
3354 __pyx_pybuffernd_q_vals.data = NULL;
3355 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3357 __Pyx_BufFmt_StackElem __pyx_stack[1];
3358 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3360 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3362 __Pyx_BufFmt_StackElem __pyx_stack[1];
3363 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3365 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3374 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3375 __pyx_t_2 = __pyx_t_1;
3376 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3377 __pyx_v_eN = __pyx_t_3;
3386 __pyx_t_4 = __pyx_v_eN;
3388 if (__pyx_t_4 < 0) {
3389 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3390 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
3391 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3392 if (unlikely(__pyx_t_5 != -1)) {
3393 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3394 __PYX_ERR(0, 64, __pyx_L1_error)
3396 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3405 __pyx_t_6 = (__pyx_v_q_vals->dimensions[1]);
3406 __pyx_t_7 = __pyx_t_6;
3407 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
3408 __pyx_v_k = __pyx_t_5;
3417 if (unlikely(__pyx_v_material_functions == Py_None)) {
3418 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3419 __PYX_ERR(0, 66, __pyx_L1_error)
3421 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_8);
3423 __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3424 __Pyx_GOTREF(__pyx_t_9);
3425 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3426 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3427 __Pyx_GOTREF(__pyx_t_8);
3428 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3429 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3430 __Pyx_GOTREF(__pyx_t_9);
3431 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error)
3432 __Pyx_GOTREF(__pyx_t_10);
3433 __pyx_t_11 = PyTuple_New(3);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 66, __pyx_L1_error)
3434 __Pyx_GOTREF(__pyx_t_11);
3435 __Pyx_GIVEREF(__pyx_t_9);
3436 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3437 __Pyx_GIVEREF(__pyx_t_10);
3438 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
3439 __Pyx_INCREF(__pyx_slice_);
3440 __Pyx_GIVEREF(__pyx_slice_);
3441 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_slice_);
3444 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_11, __pyx_t_8) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3445 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3446 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3459 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3462 __Pyx_XDECREF(__pyx_t_8);
3463 __Pyx_XDECREF(__pyx_t_9);
3464 __Pyx_XDECREF(__pyx_t_10);
3465 __Pyx_XDECREF(__pyx_t_11);
3466 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3467 __Pyx_PyThreadState_declare
3468 __Pyx_PyThreadState_assign
3469 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3470 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3471 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3472 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3473 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3477 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3478 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3480 __Pyx_XGIVEREF(__pyx_r);
3481 __Pyx_RefNannyFinishContext();
3494 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3495 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3496 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3497 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3498 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3499 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3500 PyArrayObject *__pyx_v_ebq_vals = 0;
3501 PyObject *__pyx_v_material_functions = 0;
3502 int __pyx_lineno = 0;
3503 const char *__pyx_filename = NULL;
3504 int __pyx_clineno = 0;
3505 PyObject *__pyx_r = 0;
3506 __Pyx_RefNannyDeclarations
3507 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3509 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3510 PyObject* values[4] = {0,0,0,0};
3511 if (unlikely(__pyx_kwds)) {
3513 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3515 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3517 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3519 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3521 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3524 default:
goto __pyx_L5_argtuple_error;
3526 kw_args = PyDict_Size(__pyx_kwds);
3529 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3530 else goto __pyx_L5_argtuple_error;
3533 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3535 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3539 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3541 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3545 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3547 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3550 if (unlikely(kw_args > 0)) {
3551 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3553 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3554 goto __pyx_L5_argtuple_error;
3556 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3557 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3558 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3559 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3561 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3562 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3563 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3564 __pyx_v_material_functions = ((PyObject*)values[3]);
3566 goto __pyx_L4_argument_unpacking_done;
3567 __pyx_L5_argtuple_error:;
3568 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3570 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3571 __Pyx_RefNannyFinishContext();
3573 __pyx_L4_argument_unpacking_done:;
3574 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3575 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3576 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3577 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3578 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3585 __Pyx_RefNannyFinishContext();
3589 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3592 int __pyx_v_ebN_local;
3594 int __pyx_v_material_left;
3595 int __pyx_v_material_right;
3596 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3597 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3598 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3599 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3600 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3601 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3602 PyObject *__pyx_r = NULL;
3603 __Pyx_RefNannyDeclarations
3610 Py_ssize_t __pyx_t_7;
3611 Py_ssize_t __pyx_t_8;
3613 npy_intp __pyx_t_10;
3614 npy_intp __pyx_t_11;
3615 PyObject *__pyx_t_12 = NULL;
3616 PyObject *__pyx_t_13 = NULL;
3617 PyObject *__pyx_t_14 = NULL;
3618 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
3619 Py_ssize_t __pyx_t_16;
3621 int __pyx_lineno = 0;
3622 const char *__pyx_filename = NULL;
3623 int __pyx_clineno = 0;
3624 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3625 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3626 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3627 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3628 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3629 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3630 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3631 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3632 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3633 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3634 __pyx_pybuffer_ebq_vals.refcount = 0;
3635 __pyx_pybuffernd_ebq_vals.data = NULL;
3636 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3638 __Pyx_BufFmt_StackElem __pyx_stack[1];
3639 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3641 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3643 __Pyx_BufFmt_StackElem __pyx_stack[1];
3644 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3646 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3648 __Pyx_BufFmt_StackElem __pyx_stack[1];
3649 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3651 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3660 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3661 __pyx_t_2 = __pyx_t_1;
3662 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
3663 __pyx_v_eN = __pyx_t_3;
3672 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
3673 __pyx_t_5 = __pyx_t_4;
3674 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3675 __pyx_v_ebN_local = __pyx_t_6;
3684 __pyx_t_7 = __pyx_v_eN;
3685 __pyx_t_8 = __pyx_v_ebN_local;
3687 if (__pyx_t_7 < 0) {
3688 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3689 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3690 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
3691 if (__pyx_t_8 < 0) {
3692 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3693 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3694 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
3695 if (unlikely(__pyx_t_9 != -1)) {
3696 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3697 __PYX_ERR(0, 84, __pyx_L1_error)
3699 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3708 __pyx_t_8 = __pyx_v_ebN;
3711 if (__pyx_t_8 < 0) {
3712 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3713 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
3714 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3715 if (__pyx_t_7 < 0) {
3716 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3717 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
3718 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3719 if (unlikely(__pyx_t_9 != -1)) {
3720 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3721 __PYX_ERR(0, 85, __pyx_L1_error)
3723 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3732 __pyx_t_7 = __pyx_v_ebN;
3735 if (__pyx_t_7 < 0) {
3736 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3737 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
3738 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
3739 if (__pyx_t_8 < 0) {
3740 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3741 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
3742 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
3743 if (unlikely(__pyx_t_9 != -1)) {
3744 __Pyx_RaiseBufferIndexError(__pyx_t_9);
3745 __PYX_ERR(0, 86, __pyx_L1_error)
3747 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3756 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
3757 __pyx_t_11 = __pyx_t_10;
3758 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
3759 __pyx_v_k = __pyx_t_9;
3768 if (unlikely(__pyx_v_material_functions == Py_None)) {
3769 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3770 __PYX_ERR(0, 88, __pyx_L1_error)
3772 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3773 __Pyx_GOTREF(__pyx_t_12);
3774 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error)
3775 __Pyx_GOTREF(__pyx_t_13);
3776 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3785 if (unlikely(__pyx_v_material_functions == Py_None)) {
3786 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3787 __PYX_ERR(0, 89, __pyx_L1_error)
3789 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L1_error)
3790 __Pyx_GOTREF(__pyx_t_12);
3791 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 89, __pyx_L1_error)
3792 __Pyx_GOTREF(__pyx_t_14);
3793 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3802 __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L1_error)
3803 __Pyx_GOTREF(__pyx_t_12);
3804 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3805 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3806 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 88, __pyx_L1_error)
3807 __Pyx_GOTREF(__pyx_t_14);
3808 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3809 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3810 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3811 __pyx_t_8 = __pyx_v_eN;
3812 __pyx_t_7 = __pyx_v_ebN_local;
3813 __pyx_t_16 = __pyx_v_k;
3815 if (__pyx_t_8 < 0) {
3816 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3817 if (unlikely(__pyx_t_8 < 0)) __pyx_t_17 = 0;
3818 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_17 = 0;
3819 if (__pyx_t_7 < 0) {
3820 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3821 if (unlikely(__pyx_t_7 < 0)) __pyx_t_17 = 1;
3822 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_17 = 1;
3823 if (__pyx_t_16 < 0) {
3824 __pyx_t_16 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3825 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 2;
3826 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_17 = 2;
3827 if (unlikely(__pyx_t_17 != -1)) {
3828 __Pyx_RaiseBufferIndexError(__pyx_t_17);
3829 __PYX_ERR(0, 88, __pyx_L1_error)
3831 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_15;
3845 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3848 __Pyx_XDECREF(__pyx_t_12);
3849 __Pyx_XDECREF(__pyx_t_13);
3850 __Pyx_XDECREF(__pyx_t_14);
3851 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3852 __Pyx_PyThreadState_declare
3853 __Pyx_PyThreadState_assign
3854 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3855 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3856 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3857 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3858 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3859 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3863 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3864 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3865 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3867 __Pyx_XGIVEREF(__pyx_r);
3868 __Pyx_RefNannyFinishContext();
3881 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3882 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3883 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3884 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3886 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3887 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3888 PyArrayObject *__pyx_v_ebq_vals = 0;
3889 PyObject *__pyx_v_material_functions = 0;
3890 int __pyx_lineno = 0;
3891 const char *__pyx_filename = NULL;
3892 int __pyx_clineno = 0;
3893 PyObject *__pyx_r = 0;
3894 __Pyx_RefNannyDeclarations
3895 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3897 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3898 PyObject* values[5] = {0,0,0,0,0};
3899 if (unlikely(__pyx_kwds)) {
3901 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3903 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3905 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3907 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3909 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3911 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3914 default:
goto __pyx_L5_argtuple_error;
3916 kw_args = PyDict_Size(__pyx_kwds);
3919 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3920 else goto __pyx_L5_argtuple_error;
3923 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3925 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
3929 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3931 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
3935 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3937 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
3941 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3943 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
3946 if (unlikely(kw_args > 0)) {
3947 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3949 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3950 goto __pyx_L5_argtuple_error;
3952 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3953 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3954 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3955 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3956 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3958 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
3959 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3960 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3961 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3962 __pyx_v_material_functions = ((PyObject*)values[4]);
3964 goto __pyx_L4_argument_unpacking_done;
3965 __pyx_L5_argtuple_error:;
3966 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3968 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3969 __Pyx_RefNannyFinishContext();
3971 __pyx_L4_argument_unpacking_done:;
3972 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
3973 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
3974 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3975 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
3976 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3983 __Pyx_RefNannyFinishContext();
3987 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3990 int __pyx_v_ebN_local;
3992 int __pyx_v_material_left;
3993 int __pyx_v_material_right;
3996 double __pyx_v_numer;
3997 double __pyx_v_denom;
3998 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3999 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
4000 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4001 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4002 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4003 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4004 PyObject *__pyx_r = NULL;
4005 __Pyx_RefNannyDeclarations
4012 Py_ssize_t __pyx_t_7;
4013 Py_ssize_t __pyx_t_8;
4015 npy_intp __pyx_t_10;
4016 npy_intp __pyx_t_11;
4023 PyObject *__pyx_t_18 = NULL;
4024 PyObject *__pyx_t_19 = NULL;
4025 PyObject *__pyx_t_20 = NULL;
4026 PyObject *__pyx_t_21 = NULL;
4027 PyObject *__pyx_t_22 = NULL;
4029 Py_ssize_t __pyx_t_24;
4030 Py_ssize_t __pyx_t_25;
4032 int __pyx_lineno = 0;
4033 const char *__pyx_filename = NULL;
4034 int __pyx_clineno = 0;
4035 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
4036 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4037 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4038 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4039 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4040 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4041 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4042 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4043 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4044 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
4045 __pyx_pybuffer_ebq_vals.refcount = 0;
4046 __pyx_pybuffernd_ebq_vals.data = NULL;
4047 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
4049 __Pyx_BufFmt_StackElem __pyx_stack[1];
4050 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4052 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4054 __Pyx_BufFmt_StackElem __pyx_stack[1];
4055 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4057 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4059 __Pyx_BufFmt_StackElem __pyx_stack[1];
4060 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
4062 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
4071 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
4072 __pyx_t_2 = __pyx_t_1;
4073 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4074 __pyx_v_eN = __pyx_t_3;
4083 __pyx_t_4 = (__pyx_v_ebq_vals->dimensions[1]);
4084 __pyx_t_5 = __pyx_t_4;
4085 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
4086 __pyx_v_ebN_local = __pyx_t_6;
4095 __pyx_t_7 = __pyx_v_eN;
4096 __pyx_t_8 = __pyx_v_ebN_local;
4098 if (__pyx_t_7 < 0) {
4099 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
4100 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4101 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
4102 if (__pyx_t_8 < 0) {
4103 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
4104 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4105 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
4106 if (unlikely(__pyx_t_9 != -1)) {
4107 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4108 __PYX_ERR(0, 108, __pyx_L1_error)
4110 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
4119 __pyx_t_8 = __pyx_v_ebN;
4122 if (__pyx_t_8 < 0) {
4123 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4124 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
4125 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4126 if (__pyx_t_7 < 0) {
4127 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4128 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
4129 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4130 if (unlikely(__pyx_t_9 != -1)) {
4131 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4132 __PYX_ERR(0, 109, __pyx_L1_error)
4134 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4143 __pyx_t_7 = __pyx_v_ebN;
4146 if (__pyx_t_7 < 0) {
4147 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4148 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
4149 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
4150 if (__pyx_t_8 < 0) {
4151 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4152 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
4153 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
4154 if (unlikely(__pyx_t_9 != -1)) {
4155 __Pyx_RaiseBufferIndexError(__pyx_t_9);
4156 __PYX_ERR(0, 110, __pyx_L1_error)
4158 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4167 __pyx_t_10 = (__pyx_v_ebq_vals->dimensions[2]);
4168 __pyx_t_11 = __pyx_t_10;
4169 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
4170 __pyx_v_k = __pyx_t_9;
4179 __pyx_t_12 = __pyx_v_nd;
4180 __pyx_t_13 = __pyx_t_12;
4181 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
4182 __pyx_v_I = __pyx_t_14;
4191 __pyx_t_15 = __pyx_v_nd;
4192 __pyx_t_16 = __pyx_t_15;
4193 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
4194 __pyx_v_J = __pyx_t_17;
4203 if (unlikely(__pyx_v_material_functions == Py_None)) {
4204 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4205 __PYX_ERR(0, 114, __pyx_L1_error)
4207 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4208 __Pyx_GOTREF(__pyx_t_18);
4209 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4210 __Pyx_GOTREF(__pyx_t_19);
4211 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4212 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4213 __Pyx_GOTREF(__pyx_t_18);
4214 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4215 __Pyx_GOTREF(__pyx_t_20);
4216 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4217 __Pyx_GOTREF(__pyx_t_21);
4218 __Pyx_GIVEREF(__pyx_t_18);
4219 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
4220 __Pyx_GIVEREF(__pyx_t_20);
4221 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_20);
4224 __pyx_t_20 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4225 __Pyx_GOTREF(__pyx_t_20);
4226 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4227 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4228 __pyx_t_21 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
4229 __Pyx_GOTREF(__pyx_t_21);
4230 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4231 if (unlikely(__pyx_v_material_functions == Py_None)) {
4232 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4233 __PYX_ERR(0, 114, __pyx_L1_error)
4235 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4236 __Pyx_GOTREF(__pyx_t_20);
4237 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
4238 __Pyx_GOTREF(__pyx_t_19);
4239 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4240 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
4241 __Pyx_GOTREF(__pyx_t_20);
4242 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4243 __Pyx_GOTREF(__pyx_t_18);
4244 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4245 __Pyx_GOTREF(__pyx_t_22);
4246 __Pyx_GIVEREF(__pyx_t_20);
4247 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20);
4248 __Pyx_GIVEREF(__pyx_t_18);
4249 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18);
4252 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
4253 __Pyx_GOTREF(__pyx_t_18);
4254 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4255 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4256 __pyx_t_22 = PyNumber_Multiply(__pyx_t_21, __pyx_t_18);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 114, __pyx_L1_error)
4257 __Pyx_GOTREF(__pyx_t_22);
4258 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4259 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4260 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4261 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4262 __pyx_v_numer = __pyx_t_23;
4271 if (unlikely(__pyx_v_material_functions == Py_None)) {
4272 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4273 __PYX_ERR(0, 115, __pyx_L1_error)
4275 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4276 __Pyx_GOTREF(__pyx_t_22);
4277 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4278 __Pyx_GOTREF(__pyx_t_18);
4279 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4280 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4281 __Pyx_GOTREF(__pyx_t_22);
4282 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4283 __Pyx_GOTREF(__pyx_t_21);
4284 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4285 __Pyx_GOTREF(__pyx_t_19);
4286 __Pyx_GIVEREF(__pyx_t_22);
4287 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22);
4288 __Pyx_GIVEREF(__pyx_t_21);
4289 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
4292 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
4293 __Pyx_GOTREF(__pyx_t_21);
4294 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4295 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4296 if (unlikely(__pyx_v_material_functions == Py_None)) {
4297 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4298 __PYX_ERR(0, 115, __pyx_L1_error)
4300 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4301 __Pyx_GOTREF(__pyx_t_19);
4302 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_18);
4304 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
4305 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
4306 __Pyx_GOTREF(__pyx_t_19);
4307 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4308 __Pyx_GOTREF(__pyx_t_22);
4309 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4310 __Pyx_GOTREF(__pyx_t_20);
4311 __Pyx_GIVEREF(__pyx_t_19);
4312 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
4313 __Pyx_GIVEREF(__pyx_t_22);
4314 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_22);
4317 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4318 __Pyx_GOTREF(__pyx_t_22);
4319 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
4320 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4321 __pyx_t_20 = PyNumber_Add(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
4322 __Pyx_GOTREF(__pyx_t_20);
4323 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
4324 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4325 __pyx_t_22 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 115, __pyx_L1_error)
4326 __Pyx_GOTREF(__pyx_t_22);
4327 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
4328 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_22);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
4329 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
4330 __pyx_v_denom = __pyx_t_23;
4339 if (unlikely(__pyx_v_denom == 0)) {
4340 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4341 __PYX_ERR(0, 116, __pyx_L1_error)
4343 __pyx_t_8 = __pyx_v_eN;
4344 __pyx_t_7 = __pyx_v_ebN_local;
4345 __pyx_t_24 = __pyx_v_k;
4346 __pyx_t_25 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4348 if (__pyx_t_8 < 0) {
4349 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4350 if (unlikely(__pyx_t_8 < 0)) __pyx_t_26 = 0;
4351 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_26 = 0;
4352 if (__pyx_t_7 < 0) {
4353 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4354 if (unlikely(__pyx_t_7 < 0)) __pyx_t_26 = 1;
4355 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_26 = 1;
4356 if (__pyx_t_24 < 0) {
4357 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4358 if (unlikely(__pyx_t_24 < 0)) __pyx_t_26 = 2;
4359 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_26 = 2;
4360 if (__pyx_t_25 < 0) {
4361 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4362 if (unlikely(__pyx_t_25 < 0)) __pyx_t_26 = 3;
4363 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_26 = 3;
4364 if (unlikely(__pyx_t_26 != -1)) {
4365 __Pyx_RaiseBufferIndexError(__pyx_t_26);
4366 __PYX_ERR(0, 116, __pyx_L1_error)
4368 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4384 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4387 __Pyx_XDECREF(__pyx_t_18);
4388 __Pyx_XDECREF(__pyx_t_19);
4389 __Pyx_XDECREF(__pyx_t_20);
4390 __Pyx_XDECREF(__pyx_t_21);
4391 __Pyx_XDECREF(__pyx_t_22);
4392 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4393 __Pyx_PyThreadState_declare
4394 __Pyx_PyThreadState_assign
4395 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4396 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4398 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4399 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4400 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4404 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4405 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4406 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4408 __Pyx_XGIVEREF(__pyx_r);
4409 __Pyx_RefNannyFinishContext();
4422 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4423 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4424 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4425 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4426 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4427 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4428 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4429 PyObject *__pyx_v_material_functions = 0;
4430 int __pyx_lineno = 0;
4431 const char *__pyx_filename = NULL;
4432 int __pyx_clineno = 0;
4433 PyObject *__pyx_r = 0;
4434 __Pyx_RefNannyDeclarations
4435 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4437 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4438 PyObject* values[4] = {0,0,0,0};
4439 if (unlikely(__pyx_kwds)) {
4441 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4443 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4445 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4447 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4449 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4452 default:
goto __pyx_L5_argtuple_error;
4454 kw_args = PyDict_Size(__pyx_kwds);
4457 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4458 else goto __pyx_L5_argtuple_error;
4461 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4463 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4467 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4469 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4473 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4475 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4478 if (unlikely(kw_args > 0)) {
4479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4481 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4482 goto __pyx_L5_argtuple_error;
4484 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4485 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4486 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4487 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4489 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4490 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4491 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4492 __pyx_v_material_functions = ((PyObject*)values[3]);
4494 goto __pyx_L4_argument_unpacking_done;
4495 __pyx_L5_argtuple_error:;
4496 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4498 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4499 __Pyx_RefNannyFinishContext();
4501 __pyx_L4_argument_unpacking_done:;
4502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4504 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4505 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4506 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4513 __Pyx_RefNannyFinishContext();
4517 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4519 int __pyx_v_material_left;
4520 int __pyx_v_material_right;
4522 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4523 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4524 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4525 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4526 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4527 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4528 PyObject *__pyx_r = NULL;
4529 __Pyx_RefNannyDeclarations
4533 Py_ssize_t __pyx_t_4;
4534 Py_ssize_t __pyx_t_5;
4539 PyObject *__pyx_t_10 = NULL;
4540 PyObject *__pyx_t_11 = NULL;
4541 PyObject *__pyx_t_12 = NULL;
4542 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4543 int __pyx_lineno = 0;
4544 const char *__pyx_filename = NULL;
4545 int __pyx_clineno = 0;
4546 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4547 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4548 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4549 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4550 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4551 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4552 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4553 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4554 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4555 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4556 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4557 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4558 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4560 __Pyx_BufFmt_StackElem __pyx_stack[1];
4561 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4563 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4565 __Pyx_BufFmt_StackElem __pyx_stack[1];
4566 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4568 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4570 __Pyx_BufFmt_StackElem __pyx_stack[1];
4571 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4573 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4582 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4583 __pyx_t_2 = __pyx_t_1;
4584 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4585 __pyx_v_ebN = __pyx_t_3;
4594 __pyx_t_4 = __pyx_v_ebN;
4597 if (__pyx_t_4 < 0) {
4598 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4599 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4600 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4601 if (__pyx_t_5 < 0) {
4602 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4603 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4604 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4605 if (unlikely(__pyx_t_6 != -1)) {
4606 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4607 __PYX_ERR(0, 132, __pyx_L1_error)
4609 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4618 __pyx_t_5 = __pyx_v_ebN;
4621 if (__pyx_t_5 < 0) {
4622 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4623 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4624 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4625 if (__pyx_t_4 < 0) {
4626 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4627 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
4628 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4629 if (unlikely(__pyx_t_6 != -1)) {
4630 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4631 __PYX_ERR(0, 133, __pyx_L1_error)
4633 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4642 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
4643 __pyx_t_8 = __pyx_t_7;
4644 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4645 __pyx_v_k = __pyx_t_9;
4654 if (unlikely(__pyx_v_material_functions == Py_None)) {
4655 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4656 __PYX_ERR(0, 135, __pyx_L1_error)
4658 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4659 __Pyx_GOTREF(__pyx_t_10);
4660 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
4661 __Pyx_GOTREF(__pyx_t_11);
4662 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4671 if (unlikely(__pyx_v_material_functions == Py_None)) {
4672 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4673 __PYX_ERR(0, 136, __pyx_L1_error)
4675 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
4676 __Pyx_GOTREF(__pyx_t_10);
4677 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4678 __Pyx_GOTREF(__pyx_t_12);
4679 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4688 __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_10);
4690 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4691 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4692 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4693 __Pyx_GOTREF(__pyx_t_12);
4694 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4695 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4696 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4697 __pyx_t_4 = __pyx_v_ebN;
4698 __pyx_t_5 = __pyx_v_k;
4700 if (__pyx_t_4 < 0) {
4701 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4702 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4703 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
4704 if (__pyx_t_5 < 0) {
4705 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4706 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4707 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
4708 if (unlikely(__pyx_t_6 != -1)) {
4709 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4710 __PYX_ERR(0, 135, __pyx_L1_error)
4712 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_13;
4725 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4728 __Pyx_XDECREF(__pyx_t_10);
4729 __Pyx_XDECREF(__pyx_t_11);
4730 __Pyx_XDECREF(__pyx_t_12);
4731 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4732 __Pyx_PyThreadState_declare
4733 __Pyx_PyThreadState_assign
4734 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4735 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4736 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4738 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4739 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4743 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4744 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4745 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4747 __Pyx_XGIVEREF(__pyx_r);
4748 __Pyx_RefNannyFinishContext();
4761 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4762 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4763 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4764 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4766 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4767 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4768 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4769 PyObject *__pyx_v_material_functions = 0;
4770 int __pyx_lineno = 0;
4771 const char *__pyx_filename = NULL;
4772 int __pyx_clineno = 0;
4773 PyObject *__pyx_r = 0;
4774 __Pyx_RefNannyDeclarations
4775 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4777 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4778 PyObject* values[5] = {0,0,0,0,0};
4779 if (unlikely(__pyx_kwds)) {
4781 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4783 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4785 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4787 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4789 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4791 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4794 default:
goto __pyx_L5_argtuple_error;
4796 kw_args = PyDict_Size(__pyx_kwds);
4799 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4800 else goto __pyx_L5_argtuple_error;
4803 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4805 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4809 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4811 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4815 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4817 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4821 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4823 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4826 if (unlikely(kw_args > 0)) {
4827 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4829 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4830 goto __pyx_L5_argtuple_error;
4832 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4833 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4834 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4835 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4836 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4838 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4839 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4840 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4841 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4842 __pyx_v_material_functions = ((PyObject*)values[4]);
4844 goto __pyx_L4_argument_unpacking_done;
4845 __pyx_L5_argtuple_error:;
4846 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4848 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4849 __Pyx_RefNannyFinishContext();
4851 __pyx_L4_argument_unpacking_done:;
4852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4853 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4854 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4855 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4856 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4863 __Pyx_RefNannyFinishContext();
4867 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4870 int __pyx_v_material_left;
4871 int __pyx_v_material_right;
4874 double __pyx_v_numer;
4875 double __pyx_v_denom;
4876 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4877 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4878 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4879 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4880 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4881 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4882 PyObject *__pyx_r = NULL;
4883 __Pyx_RefNannyDeclarations
4887 Py_ssize_t __pyx_t_4;
4888 Py_ssize_t __pyx_t_5;
4898 PyObject *__pyx_t_15 = NULL;
4899 PyObject *__pyx_t_16 = NULL;
4900 PyObject *__pyx_t_17 = NULL;
4901 PyObject *__pyx_t_18 = NULL;
4902 PyObject *__pyx_t_19 = NULL;
4904 Py_ssize_t __pyx_t_21;
4906 int __pyx_lineno = 0;
4907 const char *__pyx_filename = NULL;
4908 int __pyx_clineno = 0;
4909 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4910 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4911 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4912 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4913 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4914 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4915 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4916 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4917 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4918 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4919 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4920 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4921 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4923 __Pyx_BufFmt_StackElem __pyx_stack[1];
4924 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4926 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4928 __Pyx_BufFmt_StackElem __pyx_stack[1];
4929 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4931 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4933 __Pyx_BufFmt_StackElem __pyx_stack[1];
4934 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4936 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4945 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4946 __pyx_t_2 = __pyx_t_1;
4947 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
4948 __pyx_v_ebN = __pyx_t_3;
4957 __pyx_t_4 = __pyx_v_ebN;
4960 if (__pyx_t_4 < 0) {
4961 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4962 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
4963 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4964 if (__pyx_t_5 < 0) {
4965 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4966 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
4967 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4968 if (unlikely(__pyx_t_6 != -1)) {
4969 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4970 __PYX_ERR(0, 155, __pyx_L1_error)
4972 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4981 __pyx_t_5 = __pyx_v_ebN;
4984 if (__pyx_t_5 < 0) {
4985 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4986 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
4987 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
4988 if (__pyx_t_4 < 0) {
4989 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4990 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
4991 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
4992 if (unlikely(__pyx_t_6 != -1)) {
4993 __Pyx_RaiseBufferIndexError(__pyx_t_6);
4994 __PYX_ERR(0, 156, __pyx_L1_error)
4996 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5005 __pyx_t_7 = (__pyx_v_ebq_global_vals->dimensions[1]);
5006 __pyx_t_8 = __pyx_t_7;
5007 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
5008 __pyx_v_k = __pyx_t_6;
5017 __pyx_t_9 = __pyx_v_nd;
5018 __pyx_t_10 = __pyx_t_9;
5019 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5020 __pyx_v_I = __pyx_t_11;
5029 __pyx_t_12 = __pyx_v_nd;
5030 __pyx_t_13 = __pyx_t_12;
5031 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5032 __pyx_v_J = __pyx_t_14;
5041 if (unlikely(__pyx_v_material_functions == Py_None)) {
5042 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5043 __PYX_ERR(0, 160, __pyx_L1_error)
5045 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_15);
5047 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5048 __Pyx_GOTREF(__pyx_t_16);
5049 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5050 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_15);
5052 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5053 __Pyx_GOTREF(__pyx_t_17);
5054 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5055 __Pyx_GOTREF(__pyx_t_18);
5056 __Pyx_GIVEREF(__pyx_t_15);
5057 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_15);
5058 __Pyx_GIVEREF(__pyx_t_17);
5059 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17);
5062 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5063 __Pyx_GOTREF(__pyx_t_17);
5064 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5065 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5066 __pyx_t_18 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 160, __pyx_L1_error)
5067 __Pyx_GOTREF(__pyx_t_18);
5068 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5069 if (unlikely(__pyx_v_material_functions == Py_None)) {
5070 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5071 __PYX_ERR(0, 160, __pyx_L1_error)
5073 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5074 __Pyx_GOTREF(__pyx_t_17);
5075 __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
5076 __Pyx_GOTREF(__pyx_t_16);
5077 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5078 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
5079 __Pyx_GOTREF(__pyx_t_17);
5080 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5081 __Pyx_GOTREF(__pyx_t_15);
5082 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5083 __Pyx_GOTREF(__pyx_t_19);
5084 __Pyx_GIVEREF(__pyx_t_17);
5085 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
5086 __Pyx_GIVEREF(__pyx_t_15);
5087 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_15);
5090 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
5091 __Pyx_GOTREF(__pyx_t_15);
5092 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5093 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5094 __pyx_t_19 = PyNumber_Multiply(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 160, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_19);
5096 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5097 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5098 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
5099 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5100 __pyx_v_numer = __pyx_t_20;
5109 if (unlikely(__pyx_v_material_functions == Py_None)) {
5110 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5111 __PYX_ERR(0, 161, __pyx_L1_error)
5113 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5114 __Pyx_GOTREF(__pyx_t_19);
5115 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5116 __Pyx_GOTREF(__pyx_t_15);
5117 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5118 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5119 __Pyx_GOTREF(__pyx_t_19);
5120 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5121 __Pyx_GOTREF(__pyx_t_18);
5122 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5123 __Pyx_GOTREF(__pyx_t_16);
5124 __Pyx_GIVEREF(__pyx_t_19);
5125 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_19);
5126 __Pyx_GIVEREF(__pyx_t_18);
5127 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
5130 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 161, __pyx_L1_error)
5131 __Pyx_GOTREF(__pyx_t_18);
5132 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5133 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5134 if (unlikely(__pyx_v_material_functions == Py_None)) {
5135 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5136 __PYX_ERR(0, 161, __pyx_L1_error)
5138 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5139 __Pyx_GOTREF(__pyx_t_16);
5140 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
5141 __Pyx_GOTREF(__pyx_t_15);
5142 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5143 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
5144 __Pyx_GOTREF(__pyx_t_16);
5145 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5146 __Pyx_GOTREF(__pyx_t_19);
5147 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5148 __Pyx_GOTREF(__pyx_t_17);
5149 __Pyx_GIVEREF(__pyx_t_16);
5150 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16);
5151 __Pyx_GIVEREF(__pyx_t_19);
5152 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19);
5155 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5156 __Pyx_GOTREF(__pyx_t_19);
5157 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5158 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5159 __pyx_t_17 = PyNumber_Add(__pyx_t_18, __pyx_t_19);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
5160 __Pyx_GOTREF(__pyx_t_17);
5161 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5162 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5163 __pyx_t_19 = __Pyx_PyFloat_AddObjC(__pyx_t_17, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 161, __pyx_L1_error)
5164 __Pyx_GOTREF(__pyx_t_19);
5165 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5166 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_19);
if (unlikely((__pyx_t_20 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
5167 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
5168 __pyx_v_denom = __pyx_t_20;
5177 if (unlikely(__pyx_v_denom == 0)) {
5178 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
5179 __PYX_ERR(0, 162, __pyx_L1_error)
5181 __pyx_t_4 = __pyx_v_ebN;
5182 __pyx_t_5 = __pyx_v_k;
5183 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
5185 if (__pyx_t_4 < 0) {
5186 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
5187 if (unlikely(__pyx_t_4 < 0)) __pyx_t_22 = 0;
5188 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
5189 if (__pyx_t_5 < 0) {
5190 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
5191 if (unlikely(__pyx_t_5 < 0)) __pyx_t_22 = 1;
5192 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
5193 if (__pyx_t_21 < 0) {
5194 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
5195 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
5196 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
5197 if (unlikely(__pyx_t_22 != -1)) {
5198 __Pyx_RaiseBufferIndexError(__pyx_t_22);
5199 __PYX_ERR(0, 162, __pyx_L1_error)
5201 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
5216 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5219 __Pyx_XDECREF(__pyx_t_15);
5220 __Pyx_XDECREF(__pyx_t_16);
5221 __Pyx_XDECREF(__pyx_t_17);
5222 __Pyx_XDECREF(__pyx_t_18);
5223 __Pyx_XDECREF(__pyx_t_19);
5224 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5225 __Pyx_PyThreadState_declare
5226 __Pyx_PyThreadState_assign
5227 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5228 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5229 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5230 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5231 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5232 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5236 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
5237 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5238 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5240 __Pyx_XGIVEREF(__pyx_r);
5241 __Pyx_RefNannyFinishContext();
5254 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5255 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
5256 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
5257 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5259 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5260 PyArrayObject *__pyx_v_x = 0;
5261 PyArrayObject *__pyx_v_q_vals = 0;
5262 PyObject *__pyx_v_material_functions = 0;
5263 int __pyx_lineno = 0;
5264 const char *__pyx_filename = NULL;
5265 int __pyx_clineno = 0;
5266 PyObject *__pyx_r = 0;
5267 __Pyx_RefNannyDeclarations
5268 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
5270 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5271 PyObject* values[5] = {0,0,0,0,0};
5272 if (unlikely(__pyx_kwds)) {
5274 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5276 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5278 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5280 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5282 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5284 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5287 default:
goto __pyx_L5_argtuple_error;
5289 kw_args = PyDict_Size(__pyx_kwds);
5292 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5293 else goto __pyx_L5_argtuple_error;
5296 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5298 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
5302 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5304 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
5308 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5310 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
5314 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5316 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
5319 if (unlikely(kw_args > 0)) {
5320 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
5322 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5323 goto __pyx_L5_argtuple_error;
5325 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5326 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5327 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5328 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5329 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5331 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
5332 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5333 __pyx_v_x = ((PyArrayObject *)values[2]);
5334 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5335 __pyx_v_material_functions = ((PyObject*)values[4]);
5337 goto __pyx_L4_argument_unpacking_done;
5338 __pyx_L5_argtuple_error:;
5339 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
5341 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5342 __Pyx_RefNannyFinishContext();
5344 __pyx_L4_argument_unpacking_done:;
5345 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
5346 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
5347 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
5348 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
5349 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5356 __Pyx_RefNannyFinishContext();
5360 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5363 int __pyx_v_material;
5364 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5365 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5366 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5367 __Pyx_Buffer __pyx_pybuffer_q_vals;
5368 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5369 __Pyx_Buffer __pyx_pybuffer_x;
5370 PyObject *__pyx_r = NULL;
5371 __Pyx_RefNannyDeclarations
5375 Py_ssize_t __pyx_t_4;
5379 PyObject *__pyx_t_8 = NULL;
5380 PyObject *__pyx_t_9 = NULL;
5381 PyObject *__pyx_t_10 = NULL;
5382 PyObject *__pyx_t_11 = NULL;
5383 PyObject *__pyx_t_12 = NULL;
5385 PyObject *__pyx_t_14 = NULL;
5386 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
5387 Py_ssize_t __pyx_t_16;
5388 int __pyx_lineno = 0;
5389 const char *__pyx_filename = NULL;
5390 int __pyx_clineno = 0;
5391 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
5392 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5393 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5394 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5395 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5396 __pyx_pybuffer_x.pybuffer.buf = NULL;
5397 __pyx_pybuffer_x.refcount = 0;
5398 __pyx_pybuffernd_x.data = NULL;
5399 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5400 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5401 __pyx_pybuffer_q_vals.refcount = 0;
5402 __pyx_pybuffernd_q_vals.data = NULL;
5403 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5405 __Pyx_BufFmt_StackElem __pyx_stack[1];
5406 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5408 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5410 __Pyx_BufFmt_StackElem __pyx_stack[1];
5411 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5413 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5415 __Pyx_BufFmt_StackElem __pyx_stack[1];
5416 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5418 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5427 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5428 __pyx_t_2 = __pyx_t_1;
5429 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5430 __pyx_v_eN = __pyx_t_3;
5439 __pyx_t_4 = __pyx_v_eN;
5441 if (__pyx_t_4 < 0) {
5442 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5443 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5444 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5445 if (unlikely(__pyx_t_5 != -1)) {
5446 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5447 __PYX_ERR(0, 176, __pyx_L1_error)
5449 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5458 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5459 __pyx_t_7 = __pyx_t_6;
5460 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5461 __pyx_v_k = __pyx_t_5;
5470 if (unlikely(__pyx_v_material_functions == Py_None)) {
5471 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5472 __PYX_ERR(0, 178, __pyx_L1_error)
5474 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5475 __Pyx_GOTREF(__pyx_t_9);
5476 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5477 __Pyx_GOTREF(__pyx_t_10);
5478 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5479 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5480 __Pyx_GOTREF(__pyx_t_9);
5481 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5482 __Pyx_GOTREF(__pyx_t_11);
5483 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5484 __Pyx_GOTREF(__pyx_t_12);
5485 __Pyx_GIVEREF(__pyx_t_9);
5486 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5487 __Pyx_GIVEREF(__pyx_t_11);
5488 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5491 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 178, __pyx_L1_error)
5492 __Pyx_GOTREF(__pyx_t_11);
5493 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5494 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5495 __Pyx_GOTREF(__pyx_t_12);
5498 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5499 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5500 if (likely(__pyx_t_9)) {
5501 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5502 __Pyx_INCREF(__pyx_t_9);
5503 __Pyx_INCREF(
function);
5504 __Pyx_DECREF_SET(__pyx_t_10,
function);
5508 #if CYTHON_FAST_PYCALL
5509 if (PyFunction_Check(__pyx_t_10)) {
5510 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5511 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5512 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5513 __Pyx_GOTREF(__pyx_t_8);
5514 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5515 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5518 #if CYTHON_FAST_PYCCALL
5519 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5520 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5521 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5522 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5523 __Pyx_GOTREF(__pyx_t_8);
5524 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5525 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5529 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 178, __pyx_L1_error)
5530 __Pyx_GOTREF(__pyx_t_14);
5532 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5534 __Pyx_GIVEREF(__pyx_t_11);
5535 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5536 __Pyx_GIVEREF(__pyx_t_12);
5537 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5540 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5541 __Pyx_GOTREF(__pyx_t_8);
5542 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5544 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5545 __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_15 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5546 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5547 __pyx_t_4 = __pyx_v_eN;
5548 __pyx_t_16 = __pyx_v_k;
5550 if (__pyx_t_4 < 0) {
5551 __pyx_t_4 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5552 if (unlikely(__pyx_t_4 < 0)) __pyx_t_13 = 0;
5553 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_13 = 0;
5554 if (__pyx_t_16 < 0) {
5555 __pyx_t_16 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5556 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 1;
5557 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_13 = 1;
5558 if (unlikely(__pyx_t_13 != -1)) {
5559 __Pyx_RaiseBufferIndexError(__pyx_t_13);
5560 __PYX_ERR(0, 178, __pyx_L1_error)
5562 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_15;
5575 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5578 __Pyx_XDECREF(__pyx_t_8);
5579 __Pyx_XDECREF(__pyx_t_9);
5580 __Pyx_XDECREF(__pyx_t_10);
5581 __Pyx_XDECREF(__pyx_t_11);
5582 __Pyx_XDECREF(__pyx_t_12);
5583 __Pyx_XDECREF(__pyx_t_14);
5584 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5585 __Pyx_PyThreadState_declare
5586 __Pyx_PyThreadState_assign
5587 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5588 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5589 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5590 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5591 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5592 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5597 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5598 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5600 __Pyx_XGIVEREF(__pyx_r);
5601 __Pyx_RefNannyFinishContext();
5614 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5615 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5616 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5617 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5619 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5620 PyArrayObject *__pyx_v_x = 0;
5621 PyArrayObject *__pyx_v_q_vals = 0;
5622 PyObject *__pyx_v_material_functions = 0;
5623 int __pyx_lineno = 0;
5624 const char *__pyx_filename = NULL;
5625 int __pyx_clineno = 0;
5626 PyObject *__pyx_r = 0;
5627 __Pyx_RefNannyDeclarations
5628 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5630 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5631 PyObject* values[5] = {0,0,0,0,0};
5632 if (unlikely(__pyx_kwds)) {
5634 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5636 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5638 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5640 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5642 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5644 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5647 default:
goto __pyx_L5_argtuple_error;
5649 kw_args = PyDict_Size(__pyx_kwds);
5652 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5653 else goto __pyx_L5_argtuple_error;
5656 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5658 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5662 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5664 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5668 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5670 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5674 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5676 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5679 if (unlikely(kw_args > 0)) {
5680 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5682 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5683 goto __pyx_L5_argtuple_error;
5685 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5686 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5687 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5688 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5689 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5691 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5692 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5693 __pyx_v_x = ((PyArrayObject *)values[2]);
5694 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5695 __pyx_v_material_functions = ((PyObject*)values[4]);
5697 goto __pyx_L4_argument_unpacking_done;
5698 __pyx_L5_argtuple_error:;
5699 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5701 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5702 __Pyx_RefNannyFinishContext();
5704 __pyx_L4_argument_unpacking_done:;
5705 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5707 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5708 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5709 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5716 __Pyx_RefNannyFinishContext();
5720 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5723 int __pyx_v_material;
5724 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5725 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5726 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5727 __Pyx_Buffer __pyx_pybuffer_q_vals;
5728 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5729 __Pyx_Buffer __pyx_pybuffer_x;
5730 PyObject *__pyx_r = NULL;
5731 __Pyx_RefNannyDeclarations
5735 Py_ssize_t __pyx_t_4;
5739 PyObject *__pyx_t_8 = NULL;
5740 PyObject *__pyx_t_9 = NULL;
5741 PyObject *__pyx_t_10 = NULL;
5742 PyObject *__pyx_t_11 = NULL;
5743 PyObject *__pyx_t_12 = NULL;
5745 PyObject *__pyx_t_14 = NULL;
5746 int __pyx_lineno = 0;
5747 const char *__pyx_filename = NULL;
5748 int __pyx_clineno = 0;
5749 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5750 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5751 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5752 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5753 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5754 __pyx_pybuffer_x.pybuffer.buf = NULL;
5755 __pyx_pybuffer_x.refcount = 0;
5756 __pyx_pybuffernd_x.data = NULL;
5757 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5758 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5759 __pyx_pybuffer_q_vals.refcount = 0;
5760 __pyx_pybuffernd_q_vals.data = NULL;
5761 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5763 __Pyx_BufFmt_StackElem __pyx_stack[1];
5764 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5766 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5768 __Pyx_BufFmt_StackElem __pyx_stack[1];
5769 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5771 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5773 __Pyx_BufFmt_StackElem __pyx_stack[1];
5774 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5776 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5785 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5786 __pyx_t_2 = __pyx_t_1;
5787 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
5788 __pyx_v_eN = __pyx_t_3;
5797 __pyx_t_4 = __pyx_v_eN;
5799 if (__pyx_t_4 < 0) {
5800 __pyx_t_4 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5801 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
5802 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
5803 if (unlikely(__pyx_t_5 != -1)) {
5804 __Pyx_RaiseBufferIndexError(__pyx_t_5);
5805 __PYX_ERR(0, 190, __pyx_L1_error)
5807 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5816 __pyx_t_6 = (__pyx_v_x->dimensions[1]);
5817 __pyx_t_7 = __pyx_t_6;
5818 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_7; __pyx_t_5+=1) {
5819 __pyx_v_k = __pyx_t_5;
5828 if (unlikely(__pyx_v_material_functions == Py_None)) {
5829 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5830 __PYX_ERR(0, 192, __pyx_L1_error)
5832 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5833 __Pyx_GOTREF(__pyx_t_9);
5834 __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5835 __Pyx_GOTREF(__pyx_t_10);
5836 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5837 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5838 __Pyx_GOTREF(__pyx_t_9);
5839 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_11);
5841 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5842 __Pyx_GOTREF(__pyx_t_12);
5843 __Pyx_GIVEREF(__pyx_t_9);
5844 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
5845 __Pyx_GIVEREF(__pyx_t_11);
5846 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
5849 __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_12);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 192, __pyx_L1_error)
5850 __Pyx_GOTREF(__pyx_t_11);
5851 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5852 __pyx_t_12 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5853 __Pyx_GOTREF(__pyx_t_12);
5856 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
5857 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
5858 if (likely(__pyx_t_9)) {
5859 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
5860 __Pyx_INCREF(__pyx_t_9);
5861 __Pyx_INCREF(
function);
5862 __Pyx_DECREF_SET(__pyx_t_10,
function);
5866 #if CYTHON_FAST_PYCALL
5867 if (PyFunction_Check(__pyx_t_10)) {
5868 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5869 __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5870 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5871 __Pyx_GOTREF(__pyx_t_8);
5872 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5873 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5876 #if CYTHON_FAST_PYCCALL
5877 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
5878 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_11, __pyx_t_12};
5879 __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5880 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5881 __Pyx_GOTREF(__pyx_t_8);
5882 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5883 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5887 __pyx_t_14 = PyTuple_New(2+__pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5888 __Pyx_GOTREF(__pyx_t_14);
5890 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __pyx_t_9 = NULL;
5892 __Pyx_GIVEREF(__pyx_t_11);
5893 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_11);
5894 __Pyx_GIVEREF(__pyx_t_12);
5895 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_12);
5898 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5899 __Pyx_GOTREF(__pyx_t_8);
5900 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5902 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5903 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flat);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5904 __Pyx_GOTREF(__pyx_t_10);
5905 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5906 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5907 __Pyx_GOTREF(__pyx_t_8);
5908 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 192, __pyx_L1_error)
5909 __Pyx_GOTREF(__pyx_t_14);
5910 __pyx_t_12 = PyTuple_New(3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5911 __Pyx_GOTREF(__pyx_t_12);
5912 __Pyx_GIVEREF(__pyx_t_8);
5913 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
5914 __Pyx_GIVEREF(__pyx_t_14);
5915 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
5916 __Pyx_INCREF(__pyx_slice_);
5917 __Pyx_GIVEREF(__pyx_slice_);
5918 PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_slice_);
5921 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_12, __pyx_t_10) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5922 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5923 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5936 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5939 __Pyx_XDECREF(__pyx_t_8);
5940 __Pyx_XDECREF(__pyx_t_9);
5941 __Pyx_XDECREF(__pyx_t_10);
5942 __Pyx_XDECREF(__pyx_t_11);
5943 __Pyx_XDECREF(__pyx_t_12);
5944 __Pyx_XDECREF(__pyx_t_14);
5945 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5946 __Pyx_PyThreadState_declare
5947 __Pyx_PyThreadState_assign
5948 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5949 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5950 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5951 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5952 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5953 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5957 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5958 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5959 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5961 __Pyx_XGIVEREF(__pyx_r);
5962 __Pyx_RefNannyFinishContext();
5975 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5976 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5977 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5978 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5980 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5981 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5982 PyArrayObject *__pyx_v_x = 0;
5983 PyArrayObject *__pyx_v_ebq_vals = 0;
5984 PyObject *__pyx_v_material_functions = 0;
5985 int __pyx_lineno = 0;
5986 const char *__pyx_filename = NULL;
5987 int __pyx_clineno = 0;
5988 PyObject *__pyx_r = 0;
5989 __Pyx_RefNannyDeclarations
5990 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5992 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5993 PyObject* values[6] = {0,0,0,0,0,0};
5994 if (unlikely(__pyx_kwds)) {
5996 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5998 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6000 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6002 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6004 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6006 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6008 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6011 default:
goto __pyx_L5_argtuple_error;
6013 kw_args = PyDict_Size(__pyx_kwds);
6016 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6017 else goto __pyx_L5_argtuple_error;
6020 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6022 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
6026 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6028 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
6032 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6034 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
6038 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6040 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
6044 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6046 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
6049 if (unlikely(kw_args > 0)) {
6050 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
6052 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6053 goto __pyx_L5_argtuple_error;
6055 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6056 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6057 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6058 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6059 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6060 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6062 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
6063 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
6064 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
6065 __pyx_v_x = ((PyArrayObject *)values[3]);
6066 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
6067 __pyx_v_material_functions = ((PyObject*)values[5]);
6069 goto __pyx_L4_argument_unpacking_done;
6070 __pyx_L5_argtuple_error:;
6071 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
6073 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6074 __Pyx_RefNannyFinishContext();
6076 __pyx_L4_argument_unpacking_done:;
6077 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
6078 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
6079 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
6080 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
6081 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
6082 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6089 __Pyx_RefNannyFinishContext();
6093 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6096 int __pyx_v_ebN_local;
6098 int __pyx_v_material_left;
6099 int __pyx_v_material_right;
6100 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6101 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6102 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6103 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6104 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6105 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6106 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6107 __Pyx_Buffer __pyx_pybuffer_x;
6108 PyObject *__pyx_r = NULL;
6109 __Pyx_RefNannyDeclarations
6116 Py_ssize_t __pyx_t_7;
6117 Py_ssize_t __pyx_t_8;
6119 npy_intp __pyx_t_10;
6120 npy_intp __pyx_t_11;
6121 PyObject *__pyx_t_12 = NULL;
6122 PyObject *__pyx_t_13 = NULL;
6123 PyObject *__pyx_t_14 = NULL;
6124 PyObject *__pyx_t_15 = NULL;
6125 PyObject *__pyx_t_16 = NULL;
6126 PyObject *__pyx_t_17 = NULL;
6128 PyObject *__pyx_t_19 = NULL;
6129 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
6130 Py_ssize_t __pyx_t_21;
6131 int __pyx_lineno = 0;
6132 const char *__pyx_filename = NULL;
6133 int __pyx_clineno = 0;
6134 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
6135 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6136 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6137 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6138 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6139 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6140 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6141 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6142 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6143 __pyx_pybuffer_x.pybuffer.buf = NULL;
6144 __pyx_pybuffer_x.refcount = 0;
6145 __pyx_pybuffernd_x.data = NULL;
6146 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6147 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6148 __pyx_pybuffer_ebq_vals.refcount = 0;
6149 __pyx_pybuffernd_ebq_vals.data = NULL;
6150 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6152 __Pyx_BufFmt_StackElem __pyx_stack[1];
6153 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6155 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6157 __Pyx_BufFmt_StackElem __pyx_stack[1];
6158 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6160 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6162 __Pyx_BufFmt_StackElem __pyx_stack[1];
6163 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6165 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6167 __Pyx_BufFmt_StackElem __pyx_stack[1];
6168 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
6170 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
6179 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6180 __pyx_t_2 = __pyx_t_1;
6181 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6182 __pyx_v_eN = __pyx_t_3;
6191 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6192 __pyx_t_5 = __pyx_t_4;
6193 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6194 __pyx_v_ebN_local = __pyx_t_6;
6203 __pyx_t_7 = __pyx_v_eN;
6204 __pyx_t_8 = __pyx_v_ebN_local;
6206 if (__pyx_t_7 < 0) {
6207 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6208 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6209 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6210 if (__pyx_t_8 < 0) {
6211 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6212 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6213 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6214 if (unlikely(__pyx_t_9 != -1)) {
6215 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6216 __PYX_ERR(0, 212, __pyx_L1_error)
6218 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6227 __pyx_t_8 = __pyx_v_ebN;
6230 if (__pyx_t_8 < 0) {
6231 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6232 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6233 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6234 if (__pyx_t_7 < 0) {
6235 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6236 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6237 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6238 if (unlikely(__pyx_t_9 != -1)) {
6239 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6240 __PYX_ERR(0, 213, __pyx_L1_error)
6242 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6251 __pyx_t_7 = __pyx_v_ebN;
6254 if (__pyx_t_7 < 0) {
6255 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6256 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6257 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6258 if (__pyx_t_8 < 0) {
6259 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6260 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6261 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6262 if (unlikely(__pyx_t_9 != -1)) {
6263 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6264 __PYX_ERR(0, 214, __pyx_L1_error)
6266 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6275 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6276 __pyx_t_11 = __pyx_t_10;
6277 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6278 __pyx_v_k = __pyx_t_9;
6287 if (unlikely(__pyx_v_material_functions == Py_None)) {
6288 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6289 __PYX_ERR(0, 216, __pyx_L1_error)
6291 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6292 __Pyx_GOTREF(__pyx_t_13);
6293 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6294 __Pyx_GOTREF(__pyx_t_14);
6295 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6296 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6297 __Pyx_GOTREF(__pyx_t_13);
6298 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 216, __pyx_L1_error)
6299 __Pyx_GOTREF(__pyx_t_15);
6300 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6301 __Pyx_GOTREF(__pyx_t_16);
6302 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6303 __Pyx_GOTREF(__pyx_t_17);
6304 __Pyx_GIVEREF(__pyx_t_13);
6305 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13);
6306 __Pyx_GIVEREF(__pyx_t_15);
6307 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_15);
6308 __Pyx_GIVEREF(__pyx_t_16);
6309 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_16);
6313 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
6314 __Pyx_GOTREF(__pyx_t_16);
6315 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6316 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6317 __Pyx_GOTREF(__pyx_t_17);
6320 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6321 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6322 if (likely(__pyx_t_15)) {
6323 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6324 __Pyx_INCREF(__pyx_t_15);
6325 __Pyx_INCREF(
function);
6326 __Pyx_DECREF_SET(__pyx_t_14,
function);
6330 #if CYTHON_FAST_PYCALL
6331 if (PyFunction_Check(__pyx_t_14)) {
6332 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6333 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6334 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6335 __Pyx_GOTREF(__pyx_t_12);
6336 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6337 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6340 #if CYTHON_FAST_PYCCALL
6341 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
6342 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_16, __pyx_t_17};
6343 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6344 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6345 __Pyx_GOTREF(__pyx_t_12);
6346 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6347 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6351 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
6352 __Pyx_GOTREF(__pyx_t_13);
6354 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_15); __pyx_t_15 = NULL;
6356 __Pyx_GIVEREF(__pyx_t_16);
6357 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_16);
6358 __Pyx_GIVEREF(__pyx_t_17);
6359 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_17);
6362 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
6363 __Pyx_GOTREF(__pyx_t_12);
6364 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6366 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6375 if (unlikely(__pyx_v_material_functions == Py_None)) {
6376 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6377 __PYX_ERR(0, 217, __pyx_L1_error)
6379 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6380 __Pyx_GOTREF(__pyx_t_13);
6381 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
6382 __Pyx_GOTREF(__pyx_t_17);
6383 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6384 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6385 __Pyx_GOTREF(__pyx_t_13);
6386 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
6387 __Pyx_GOTREF(__pyx_t_16);
6388 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6389 __Pyx_GOTREF(__pyx_t_15);
6390 __pyx_t_19 = PyTuple_New(3);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6391 __Pyx_GOTREF(__pyx_t_19);
6392 __Pyx_GIVEREF(__pyx_t_13);
6393 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_13);
6394 __Pyx_GIVEREF(__pyx_t_16);
6395 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_16);
6396 __Pyx_GIVEREF(__pyx_t_15);
6397 PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_t_15);
6401 __pyx_t_15 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6402 __Pyx_GOTREF(__pyx_t_15);
6403 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6404 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 217, __pyx_L1_error)
6405 __Pyx_GOTREF(__pyx_t_19);
6408 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
6409 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
6410 if (likely(__pyx_t_16)) {
6411 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
6412 __Pyx_INCREF(__pyx_t_16);
6413 __Pyx_INCREF(
function);
6414 __Pyx_DECREF_SET(__pyx_t_17,
function);
6418 #if CYTHON_FAST_PYCALL
6419 if (PyFunction_Check(__pyx_t_17)) {
6420 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6421 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6422 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6423 __Pyx_GOTREF(__pyx_t_14);
6424 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6425 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6428 #if CYTHON_FAST_PYCCALL
6429 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
6430 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_15, __pyx_t_19};
6431 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6432 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
6433 __Pyx_GOTREF(__pyx_t_14);
6434 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6435 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6439 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 217, __pyx_L1_error)
6440 __Pyx_GOTREF(__pyx_t_13);
6442 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_16); __pyx_t_16 = NULL;
6444 __Pyx_GIVEREF(__pyx_t_15);
6445 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_15);
6446 __Pyx_GIVEREF(__pyx_t_19);
6447 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_19);
6450 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6451 __Pyx_GOTREF(__pyx_t_14);
6452 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6454 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6463 __pyx_t_17 = PyNumber_Add(__pyx_t_12, __pyx_t_14);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
6464 __Pyx_GOTREF(__pyx_t_17);
6465 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6466 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6467 __pyx_t_14 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_17);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
6468 __Pyx_GOTREF(__pyx_t_14);
6469 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6470 __pyx_t_20 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_20 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6471 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6472 __pyx_t_8 = __pyx_v_eN;
6473 __pyx_t_7 = __pyx_v_ebN_local;
6474 __pyx_t_21 = __pyx_v_k;
6476 if (__pyx_t_8 < 0) {
6477 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6478 if (unlikely(__pyx_t_8 < 0)) __pyx_t_18 = 0;
6479 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_18 = 0;
6480 if (__pyx_t_7 < 0) {
6481 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6482 if (unlikely(__pyx_t_7 < 0)) __pyx_t_18 = 1;
6483 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_18 = 1;
6484 if (__pyx_t_21 < 0) {
6485 __pyx_t_21 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6486 if (unlikely(__pyx_t_21 < 0)) __pyx_t_18 = 2;
6487 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_18 = 2;
6488 if (unlikely(__pyx_t_18 != -1)) {
6489 __Pyx_RaiseBufferIndexError(__pyx_t_18);
6490 __PYX_ERR(0, 216, __pyx_L1_error)
6492 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_20;
6506 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6509 __Pyx_XDECREF(__pyx_t_12);
6510 __Pyx_XDECREF(__pyx_t_13);
6511 __Pyx_XDECREF(__pyx_t_14);
6512 __Pyx_XDECREF(__pyx_t_15);
6513 __Pyx_XDECREF(__pyx_t_16);
6514 __Pyx_XDECREF(__pyx_t_17);
6515 __Pyx_XDECREF(__pyx_t_19);
6516 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6517 __Pyx_PyThreadState_declare
6518 __Pyx_PyThreadState_assign
6519 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6520 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6521 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6522 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6523 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6524 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6525 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6529 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6530 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6531 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6532 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6534 __Pyx_XGIVEREF(__pyx_r);
6535 __Pyx_RefNannyFinishContext();
6548 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6549 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6550 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6551 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6554 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6555 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6556 PyArrayObject *__pyx_v_x = 0;
6557 PyArrayObject *__pyx_v_ebq_vals = 0;
6558 PyObject *__pyx_v_material_functions = 0;
6559 int __pyx_lineno = 0;
6560 const char *__pyx_filename = NULL;
6561 int __pyx_clineno = 0;
6562 PyObject *__pyx_r = 0;
6563 __Pyx_RefNannyDeclarations
6564 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6566 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6567 PyObject* values[7] = {0,0,0,0,0,0,0};
6568 if (unlikely(__pyx_kwds)) {
6570 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6572 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6574 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6576 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6578 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6580 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6582 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6584 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6587 default:
goto __pyx_L5_argtuple_error;
6589 kw_args = PyDict_Size(__pyx_kwds);
6592 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6593 else goto __pyx_L5_argtuple_error;
6596 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6598 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6602 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6604 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6608 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6610 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6614 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6616 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6620 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6622 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6626 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6628 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6631 if (unlikely(kw_args > 0)) {
6632 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6634 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6635 goto __pyx_L5_argtuple_error;
6637 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6638 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6639 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6640 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6641 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6642 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6643 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6645 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6646 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6647 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6648 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6649 __pyx_v_x = ((PyArrayObject *)values[4]);
6650 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6651 __pyx_v_material_functions = ((PyObject*)values[6]);
6653 goto __pyx_L4_argument_unpacking_done;
6654 __pyx_L5_argtuple_error:;
6655 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6657 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6658 __Pyx_RefNannyFinishContext();
6660 __pyx_L4_argument_unpacking_done:;
6661 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6662 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6663 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6664 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6665 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6666 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6673 __Pyx_RefNannyFinishContext();
6677 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6680 int __pyx_v_ebN_local;
6682 int __pyx_v_material_left;
6683 int __pyx_v_material_right;
6686 double __pyx_v_numer;
6687 double __pyx_v_denom;
6688 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6689 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6690 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6691 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6692 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6693 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6694 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6695 __Pyx_Buffer __pyx_pybuffer_x;
6696 PyObject *__pyx_r = NULL;
6697 __Pyx_RefNannyDeclarations
6704 Py_ssize_t __pyx_t_7;
6705 Py_ssize_t __pyx_t_8;
6707 npy_intp __pyx_t_10;
6708 npy_intp __pyx_t_11;
6715 PyObject *__pyx_t_18 = NULL;
6716 PyObject *__pyx_t_19 = NULL;
6717 PyObject *__pyx_t_20 = NULL;
6718 PyObject *__pyx_t_21 = NULL;
6719 PyObject *__pyx_t_22 = NULL;
6720 PyObject *__pyx_t_23 = NULL;
6722 PyObject *__pyx_t_25 = NULL;
6724 Py_ssize_t __pyx_t_27;
6725 Py_ssize_t __pyx_t_28;
6726 int __pyx_lineno = 0;
6727 const char *__pyx_filename = NULL;
6728 int __pyx_clineno = 0;
6729 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6730 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6731 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6732 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6733 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6734 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6735 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6736 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6737 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6738 __pyx_pybuffer_x.pybuffer.buf = NULL;
6739 __pyx_pybuffer_x.refcount = 0;
6740 __pyx_pybuffernd_x.data = NULL;
6741 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6742 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6743 __pyx_pybuffer_ebq_vals.refcount = 0;
6744 __pyx_pybuffernd_ebq_vals.data = NULL;
6745 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6747 __Pyx_BufFmt_StackElem __pyx_stack[1];
6748 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6750 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6752 __Pyx_BufFmt_StackElem __pyx_stack[1];
6753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6755 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6757 __Pyx_BufFmt_StackElem __pyx_stack[1];
6758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6760 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6762 __Pyx_BufFmt_StackElem __pyx_stack[1];
6763 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6765 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6774 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6775 __pyx_t_2 = __pyx_t_1;
6776 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6777 __pyx_v_eN = __pyx_t_3;
6786 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
6787 __pyx_t_5 = __pyx_t_4;
6788 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6789 __pyx_v_ebN_local = __pyx_t_6;
6798 __pyx_t_7 = __pyx_v_eN;
6799 __pyx_t_8 = __pyx_v_ebN_local;
6801 if (__pyx_t_7 < 0) {
6802 __pyx_t_7 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6803 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6804 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_9 = 0;
6805 if (__pyx_t_8 < 0) {
6806 __pyx_t_8 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6807 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6808 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_9 = 1;
6809 if (unlikely(__pyx_t_9 != -1)) {
6810 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6811 __PYX_ERR(0, 238, __pyx_L1_error)
6813 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6822 __pyx_t_8 = __pyx_v_ebN;
6825 if (__pyx_t_8 < 0) {
6826 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6827 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
6828 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6829 if (__pyx_t_7 < 0) {
6830 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6831 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
6832 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6833 if (unlikely(__pyx_t_9 != -1)) {
6834 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6835 __PYX_ERR(0, 239, __pyx_L1_error)
6837 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6846 __pyx_t_7 = __pyx_v_ebN;
6849 if (__pyx_t_7 < 0) {
6850 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6851 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
6852 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_9 = 0;
6853 if (__pyx_t_8 < 0) {
6854 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6855 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
6856 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_9 = 1;
6857 if (unlikely(__pyx_t_9 != -1)) {
6858 __Pyx_RaiseBufferIndexError(__pyx_t_9);
6859 __PYX_ERR(0, 240, __pyx_L1_error)
6861 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6870 __pyx_t_10 = (__pyx_v_x->dimensions[2]);
6871 __pyx_t_11 = __pyx_t_10;
6872 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
6873 __pyx_v_k = __pyx_t_9;
6882 __pyx_t_12 = __pyx_v_nd;
6883 __pyx_t_13 = __pyx_t_12;
6884 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6885 __pyx_v_I = __pyx_t_14;
6894 __pyx_t_15 = __pyx_v_nd;
6895 __pyx_t_16 = __pyx_t_15;
6896 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
6897 __pyx_v_J = __pyx_t_17;
6906 if (unlikely(__pyx_v_material_functions == Py_None)) {
6907 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6908 __PYX_ERR(0, 244, __pyx_L1_error)
6910 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6911 __Pyx_GOTREF(__pyx_t_19);
6912 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6913 __Pyx_GOTREF(__pyx_t_20);
6914 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6915 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6916 __Pyx_GOTREF(__pyx_t_19);
6917 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
6918 __Pyx_GOTREF(__pyx_t_21);
6919 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6920 __Pyx_GOTREF(__pyx_t_22);
6921 __pyx_t_23 = PyTuple_New(3);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6922 __Pyx_GOTREF(__pyx_t_23);
6923 __Pyx_GIVEREF(__pyx_t_19);
6924 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_19);
6925 __Pyx_GIVEREF(__pyx_t_21);
6926 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
6927 __Pyx_GIVEREF(__pyx_t_22);
6928 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
6932 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6933 __Pyx_GOTREF(__pyx_t_22);
6934 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6935 __pyx_t_23 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6936 __Pyx_GOTREF(__pyx_t_23);
6939 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
6940 __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
6941 if (likely(__pyx_t_21)) {
6942 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
6943 __Pyx_INCREF(__pyx_t_21);
6944 __Pyx_INCREF(
function);
6945 __Pyx_DECREF_SET(__pyx_t_20,
function);
6949 #if CYTHON_FAST_PYCALL
6950 if (PyFunction_Check(__pyx_t_20)) {
6951 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
6952 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6953 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6954 __Pyx_GOTREF(__pyx_t_18);
6955 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6956 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6959 #if CYTHON_FAST_PYCCALL
6960 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
6961 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_22, __pyx_t_23};
6962 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6963 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6964 __Pyx_GOTREF(__pyx_t_18);
6965 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6966 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
6970 __pyx_t_19 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6971 __Pyx_GOTREF(__pyx_t_19);
6973 __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21); __pyx_t_21 = NULL;
6975 __Pyx_GIVEREF(__pyx_t_22);
6976 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_24, __pyx_t_22);
6977 __Pyx_GIVEREF(__pyx_t_23);
6978 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_24, __pyx_t_23);
6981 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6982 __Pyx_GOTREF(__pyx_t_18);
6983 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6985 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6986 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6987 __Pyx_GOTREF(__pyx_t_20);
6988 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6989 __Pyx_GOTREF(__pyx_t_19);
6990 __pyx_t_23 = PyTuple_New(2);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
6991 __Pyx_GOTREF(__pyx_t_23);
6992 __Pyx_GIVEREF(__pyx_t_20);
6993 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
6994 __Pyx_GIVEREF(__pyx_t_19);
6995 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_19);
6998 __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_23);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6999 __Pyx_GOTREF(__pyx_t_19);
7000 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7001 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7002 __pyx_t_23 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 244, __pyx_L1_error)
7003 __Pyx_GOTREF(__pyx_t_23);
7004 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7005 if (unlikely(__pyx_v_material_functions == Py_None)) {
7006 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7007 __PYX_ERR(0, 244, __pyx_L1_error)
7009 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_18);
7011 __pyx_t_20 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7012 __Pyx_GOTREF(__pyx_t_20);
7013 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7014 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7015 __Pyx_GOTREF(__pyx_t_18);
7016 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
7017 __Pyx_GOTREF(__pyx_t_22);
7018 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7019 __Pyx_GOTREF(__pyx_t_21);
7020 __pyx_t_25 = PyTuple_New(3);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7021 __Pyx_GOTREF(__pyx_t_25);
7022 __Pyx_GIVEREF(__pyx_t_18);
7023 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_18);
7024 __Pyx_GIVEREF(__pyx_t_22);
7025 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_22);
7026 __Pyx_GIVEREF(__pyx_t_21);
7027 PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_21);
7031 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_25);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
7032 __Pyx_GOTREF(__pyx_t_21);
7033 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7034 __pyx_t_25 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7035 __Pyx_GOTREF(__pyx_t_25);
7038 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7039 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20);
7040 if (likely(__pyx_t_22)) {
7041 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
7042 __Pyx_INCREF(__pyx_t_22);
7043 __Pyx_INCREF(
function);
7044 __Pyx_DECREF_SET(__pyx_t_20,
function);
7048 #if CYTHON_FAST_PYCALL
7049 if (PyFunction_Check(__pyx_t_20)) {
7050 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7051 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7052 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7053 __Pyx_GOTREF(__pyx_t_19);
7054 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7055 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7058 #if CYTHON_FAST_PYCCALL
7059 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
7060 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_25};
7061 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7062 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
7063 __Pyx_GOTREF(__pyx_t_19);
7064 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7065 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7069 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_18);
7072 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
7074 __Pyx_GIVEREF(__pyx_t_21);
7075 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_21);
7076 __Pyx_GIVEREF(__pyx_t_25);
7077 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_25);
7080 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
7081 __Pyx_GOTREF(__pyx_t_19);
7082 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7084 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7085 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_20);
7087 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_18);
7089 __pyx_t_25 = PyTuple_New(2);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7090 __Pyx_GOTREF(__pyx_t_25);
7091 __Pyx_GIVEREF(__pyx_t_20);
7092 PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20);
7093 __Pyx_GIVEREF(__pyx_t_18);
7094 PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_18);
7097 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_25);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
7098 __Pyx_GOTREF(__pyx_t_18);
7099 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7100 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7101 __pyx_t_25 = PyNumber_Multiply(__pyx_t_23, __pyx_t_18);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 244, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_25);
7103 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7104 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7105 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
7106 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7107 __pyx_v_numer = __pyx_t_26;
7116 if (unlikely(__pyx_v_material_functions == Py_None)) {
7117 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7118 __PYX_ERR(0, 245, __pyx_L1_error)
7120 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7121 __Pyx_GOTREF(__pyx_t_18);
7122 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7123 __Pyx_GOTREF(__pyx_t_23);
7124 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7125 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7126 __Pyx_GOTREF(__pyx_t_18);
7127 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7128 __Pyx_GOTREF(__pyx_t_19);
7129 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7130 __Pyx_GOTREF(__pyx_t_20);
7131 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7132 __Pyx_GOTREF(__pyx_t_21);
7133 __Pyx_GIVEREF(__pyx_t_18);
7134 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_18);
7135 __Pyx_GIVEREF(__pyx_t_19);
7136 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
7137 __Pyx_GIVEREF(__pyx_t_20);
7138 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_20);
7142 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7143 __Pyx_GOTREF(__pyx_t_20);
7144 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7145 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7146 __Pyx_GOTREF(__pyx_t_21);
7149 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7150 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_23);
7151 if (likely(__pyx_t_19)) {
7152 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7153 __Pyx_INCREF(__pyx_t_19);
7154 __Pyx_INCREF(
function);
7155 __Pyx_DECREF_SET(__pyx_t_23,
function);
7159 #if CYTHON_FAST_PYCALL
7160 if (PyFunction_Check(__pyx_t_23)) {
7161 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7162 __pyx_t_25 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7163 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7164 __Pyx_GOTREF(__pyx_t_25);
7165 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7166 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7169 #if CYTHON_FAST_PYCCALL
7170 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7171 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_20, __pyx_t_21};
7172 __pyx_t_25 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7173 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
7174 __Pyx_GOTREF(__pyx_t_25);
7175 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7176 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7180 __pyx_t_18 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7181 __Pyx_GOTREF(__pyx_t_18);
7183 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_19); __pyx_t_19 = NULL;
7185 __Pyx_GIVEREF(__pyx_t_20);
7186 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_24, __pyx_t_20);
7187 __Pyx_GIVEREF(__pyx_t_21);
7188 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_24, __pyx_t_21);
7191 __pyx_t_25 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7192 __Pyx_GOTREF(__pyx_t_25);
7193 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7195 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7196 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7197 __Pyx_GOTREF(__pyx_t_23);
7198 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7199 __Pyx_GOTREF(__pyx_t_18);
7200 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7201 __Pyx_GOTREF(__pyx_t_21);
7202 __Pyx_GIVEREF(__pyx_t_23);
7203 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_23);
7204 __Pyx_GIVEREF(__pyx_t_18);
7205 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_18);
7208 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
7209 __Pyx_GOTREF(__pyx_t_18);
7210 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7211 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7212 if (unlikely(__pyx_v_material_functions == Py_None)) {
7213 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7214 __PYX_ERR(0, 245, __pyx_L1_error)
7216 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_25);
7218 __pyx_t_23 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_25);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7219 __Pyx_GOTREF(__pyx_t_23);
7220 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7221 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7222 __Pyx_GOTREF(__pyx_t_25);
7223 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
7224 __Pyx_GOTREF(__pyx_t_20);
7225 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7226 __Pyx_GOTREF(__pyx_t_19);
7227 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7228 __Pyx_GOTREF(__pyx_t_22);
7229 __Pyx_GIVEREF(__pyx_t_25);
7230 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_25);
7231 __Pyx_GIVEREF(__pyx_t_20);
7232 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
7233 __Pyx_GIVEREF(__pyx_t_19);
7234 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_19);
7238 __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
7239 __Pyx_GOTREF(__pyx_t_19);
7240 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7241 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7242 __Pyx_GOTREF(__pyx_t_22);
7245 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
7246 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_23);
7247 if (likely(__pyx_t_20)) {
7248 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_23);
7249 __Pyx_INCREF(__pyx_t_20);
7250 __Pyx_INCREF(
function);
7251 __Pyx_DECREF_SET(__pyx_t_23,
function);
7255 #if CYTHON_FAST_PYCALL
7256 if (PyFunction_Check(__pyx_t_23)) {
7257 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7258 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7259 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7260 __Pyx_GOTREF(__pyx_t_21);
7261 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7262 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7265 #if CYTHON_FAST_PYCCALL
7266 if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
7267 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_22};
7268 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_24, 2+__pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7269 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7270 __Pyx_GOTREF(__pyx_t_21);
7271 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7272 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7276 __pyx_t_25 = PyTuple_New(2+__pyx_t_24);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7277 __Pyx_GOTREF(__pyx_t_25);
7279 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_20); __pyx_t_20 = NULL;
7281 __Pyx_GIVEREF(__pyx_t_19);
7282 PyTuple_SET_ITEM(__pyx_t_25, 0+__pyx_t_24, __pyx_t_19);
7283 __Pyx_GIVEREF(__pyx_t_22);
7284 PyTuple_SET_ITEM(__pyx_t_25, 1+__pyx_t_24, __pyx_t_22);
7287 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_25, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
7288 __Pyx_GOTREF(__pyx_t_21);
7289 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7291 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
7292 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 245, __pyx_L1_error)
7293 __Pyx_GOTREF(__pyx_t_23);
7294 __pyx_t_25 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7295 __Pyx_GOTREF(__pyx_t_25);
7296 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7297 __Pyx_GOTREF(__pyx_t_22);
7298 __Pyx_GIVEREF(__pyx_t_23);
7299 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
7300 __Pyx_GIVEREF(__pyx_t_25);
7301 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_25);
7304 __pyx_t_25 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_22);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7305 __Pyx_GOTREF(__pyx_t_25);
7306 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
7307 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7308 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_25);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
7309 __Pyx_GOTREF(__pyx_t_22);
7310 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
7311 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7312 __pyx_t_25 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 245, __pyx_L1_error)
7313 __Pyx_GOTREF(__pyx_t_25);
7314 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7315 __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_25);
if (unlikely((__pyx_t_26 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
7316 __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
7317 __pyx_v_denom = __pyx_t_26;
7326 if (unlikely(__pyx_v_denom == 0)) {
7327 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7328 __PYX_ERR(0, 246, __pyx_L1_error)
7330 __pyx_t_8 = __pyx_v_eN;
7331 __pyx_t_7 = __pyx_v_ebN_local;
7332 __pyx_t_27 = __pyx_v_k;
7333 __pyx_t_28 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7335 if (__pyx_t_8 < 0) {
7336 __pyx_t_8 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
7337 if (unlikely(__pyx_t_8 < 0)) __pyx_t_24 = 0;
7338 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_24 = 0;
7339 if (__pyx_t_7 < 0) {
7340 __pyx_t_7 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
7341 if (unlikely(__pyx_t_7 < 0)) __pyx_t_24 = 1;
7342 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_24 = 1;
7343 if (__pyx_t_27 < 0) {
7344 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
7345 if (unlikely(__pyx_t_27 < 0)) __pyx_t_24 = 2;
7346 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_24 = 2;
7347 if (__pyx_t_28 < 0) {
7348 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
7349 if (unlikely(__pyx_t_28 < 0)) __pyx_t_24 = 3;
7350 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_24 = 3;
7351 if (unlikely(__pyx_t_24 != -1)) {
7352 __Pyx_RaiseBufferIndexError(__pyx_t_24);
7353 __PYX_ERR(0, 246, __pyx_L1_error)
7355 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
7371 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7374 __Pyx_XDECREF(__pyx_t_18);
7375 __Pyx_XDECREF(__pyx_t_19);
7376 __Pyx_XDECREF(__pyx_t_20);
7377 __Pyx_XDECREF(__pyx_t_21);
7378 __Pyx_XDECREF(__pyx_t_22);
7379 __Pyx_XDECREF(__pyx_t_23);
7380 __Pyx_XDECREF(__pyx_t_25);
7381 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7382 __Pyx_PyThreadState_declare
7383 __Pyx_PyThreadState_assign
7384 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7385 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7386 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7387 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7388 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7389 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7390 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7394 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
7395 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7396 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7399 __Pyx_XGIVEREF(__pyx_r);
7400 __Pyx_RefNannyFinishContext();
7413 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7414 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7415 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
7416 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7418 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7419 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7420 PyArrayObject *__pyx_v_x = 0;
7421 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7422 PyObject *__pyx_v_material_functions = 0;
7423 int __pyx_lineno = 0;
7424 const char *__pyx_filename = NULL;
7425 int __pyx_clineno = 0;
7426 PyObject *__pyx_r = 0;
7427 __Pyx_RefNannyDeclarations
7428 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
7430 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7431 PyObject* values[6] = {0,0,0,0,0,0};
7432 if (unlikely(__pyx_kwds)) {
7434 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7436 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7438 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7440 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7442 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7444 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7446 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7449 default:
goto __pyx_L5_argtuple_error;
7451 kw_args = PyDict_Size(__pyx_kwds);
7454 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7455 else goto __pyx_L5_argtuple_error;
7458 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7460 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
7464 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7466 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
7470 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7472 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7476 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7478 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7482 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7484 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7487 if (unlikely(kw_args > 0)) {
7488 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7490 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7491 goto __pyx_L5_argtuple_error;
7493 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7494 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7495 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7496 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7497 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7498 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7500 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7501 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7502 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7503 __pyx_v_x = ((PyArrayObject *)values[3]);
7504 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7505 __pyx_v_material_functions = ((PyObject*)values[5]);
7507 goto __pyx_L4_argument_unpacking_done;
7508 __pyx_L5_argtuple_error:;
7509 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7511 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7512 __Pyx_RefNannyFinishContext();
7514 __pyx_L4_argument_unpacking_done:;
7515 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7516 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7517 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7518 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7519 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7520 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7527 __Pyx_RefNannyFinishContext();
7531 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7533 int __pyx_v_material_left;
7534 int __pyx_v_material_right;
7536 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7537 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7538 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7539 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7540 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7541 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7542 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7543 __Pyx_Buffer __pyx_pybuffer_x;
7544 PyObject *__pyx_r = NULL;
7545 __Pyx_RefNannyDeclarations
7549 Py_ssize_t __pyx_t_4;
7550 Py_ssize_t __pyx_t_5;
7555 PyObject *__pyx_t_10 = NULL;
7556 PyObject *__pyx_t_11 = NULL;
7557 PyObject *__pyx_t_12 = NULL;
7558 PyObject *__pyx_t_13 = NULL;
7559 PyObject *__pyx_t_14 = NULL;
7560 PyObject *__pyx_t_15 = NULL;
7561 PyObject *__pyx_t_16 = NULL;
7562 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
7563 int __pyx_lineno = 0;
7564 const char *__pyx_filename = NULL;
7565 int __pyx_clineno = 0;
7566 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7567 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7568 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7569 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7570 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7571 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7572 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7573 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7574 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7575 __pyx_pybuffer_x.pybuffer.buf = NULL;
7576 __pyx_pybuffer_x.refcount = 0;
7577 __pyx_pybuffernd_x.data = NULL;
7578 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7579 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7580 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7581 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7582 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7584 __Pyx_BufFmt_StackElem __pyx_stack[1];
7585 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7587 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7589 __Pyx_BufFmt_StackElem __pyx_stack[1];
7590 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7592 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7594 __Pyx_BufFmt_StackElem __pyx_stack[1];
7595 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7597 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7599 __Pyx_BufFmt_StackElem __pyx_stack[1];
7600 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7602 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7611 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7612 __pyx_t_2 = __pyx_t_1;
7613 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
7614 __pyx_v_ebN = __pyx_t_3;
7623 __pyx_t_4 = __pyx_v_ebN;
7626 if (__pyx_t_4 < 0) {
7627 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7628 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7629 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7630 if (__pyx_t_5 < 0) {
7631 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7632 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7633 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7634 if (unlikely(__pyx_t_6 != -1)) {
7635 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7636 __PYX_ERR(0, 264, __pyx_L1_error)
7638 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7647 __pyx_t_5 = __pyx_v_ebN;
7650 if (__pyx_t_5 < 0) {
7651 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7652 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
7653 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
7654 if (__pyx_t_4 < 0) {
7655 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7656 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
7657 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
7658 if (unlikely(__pyx_t_6 != -1)) {
7659 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7660 __PYX_ERR(0, 265, __pyx_L1_error)
7662 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7671 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
7672 __pyx_t_8 = __pyx_t_7;
7673 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
7674 __pyx_v_k = __pyx_t_9;
7683 if (unlikely(__pyx_v_material_functions == Py_None)) {
7684 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7685 __PYX_ERR(0, 267, __pyx_L1_error)
7687 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7688 __Pyx_GOTREF(__pyx_t_11);
7689 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7690 __Pyx_GOTREF(__pyx_t_12);
7691 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7692 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_11);
7694 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7695 __Pyx_GOTREF(__pyx_t_13);
7696 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7697 __Pyx_GOTREF(__pyx_t_14);
7698 __Pyx_GIVEREF(__pyx_t_11);
7699 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
7700 __Pyx_GIVEREF(__pyx_t_13);
7701 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
7704 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7705 __Pyx_GOTREF(__pyx_t_13);
7706 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7707 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7708 __Pyx_GOTREF(__pyx_t_14);
7711 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
7712 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
7713 if (likely(__pyx_t_11)) {
7714 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
7715 __Pyx_INCREF(__pyx_t_11);
7716 __Pyx_INCREF(
function);
7717 __Pyx_DECREF_SET(__pyx_t_12,
function);
7721 #if CYTHON_FAST_PYCALL
7722 if (PyFunction_Check(__pyx_t_12)) {
7723 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7724 __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7725 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7726 __Pyx_GOTREF(__pyx_t_10);
7727 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7728 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7731 #if CYTHON_FAST_PYCCALL
7732 if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
7733 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7734 __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7735 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7736 __Pyx_GOTREF(__pyx_t_10);
7737 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7738 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7742 __pyx_t_15 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7743 __Pyx_GOTREF(__pyx_t_15);
7745 __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __pyx_t_11 = NULL;
7747 __Pyx_GIVEREF(__pyx_t_13);
7748 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_6, __pyx_t_13);
7749 __Pyx_GIVEREF(__pyx_t_14);
7750 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_6, __pyx_t_14);
7753 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7754 __Pyx_GOTREF(__pyx_t_10);
7755 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7757 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7766 if (unlikely(__pyx_v_material_functions == Py_None)) {
7767 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7768 __PYX_ERR(0, 268, __pyx_L1_error)
7770 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7771 __Pyx_GOTREF(__pyx_t_15);
7772 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7773 __Pyx_GOTREF(__pyx_t_14);
7774 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7775 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7776 __Pyx_GOTREF(__pyx_t_15);
7777 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7778 __Pyx_GOTREF(__pyx_t_13);
7779 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7780 __Pyx_GOTREF(__pyx_t_11);
7781 __Pyx_GIVEREF(__pyx_t_15);
7782 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15);
7783 __Pyx_GIVEREF(__pyx_t_13);
7784 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
7787 __pyx_t_13 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_11);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7788 __Pyx_GOTREF(__pyx_t_13);
7789 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7790 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7791 __Pyx_GOTREF(__pyx_t_11);
7794 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7795 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
7796 if (likely(__pyx_t_15)) {
7797 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7798 __Pyx_INCREF(__pyx_t_15);
7799 __Pyx_INCREF(
function);
7800 __Pyx_DECREF_SET(__pyx_t_14,
function);
7804 #if CYTHON_FAST_PYCALL
7805 if (PyFunction_Check(__pyx_t_14)) {
7806 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7807 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7808 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7809 __Pyx_GOTREF(__pyx_t_12);
7810 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7811 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7814 #if CYTHON_FAST_PYCCALL
7815 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7816 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7817 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7818 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7819 __Pyx_GOTREF(__pyx_t_12);
7820 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7821 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7825 __pyx_t_16 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7826 __Pyx_GOTREF(__pyx_t_16);
7828 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
7830 __Pyx_GIVEREF(__pyx_t_13);
7831 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
7832 __Pyx_GIVEREF(__pyx_t_11);
7833 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
7836 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7837 __Pyx_GOTREF(__pyx_t_12);
7838 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7840 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7849 __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7850 __Pyx_GOTREF(__pyx_t_14);
7851 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7852 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7853 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7854 __Pyx_GOTREF(__pyx_t_12);
7855 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7856 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7857 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7858 __pyx_t_4 = __pyx_v_ebN;
7859 __pyx_t_5 = __pyx_v_k;
7861 if (__pyx_t_4 < 0) {
7862 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7863 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
7864 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_6 = 0;
7865 if (__pyx_t_5 < 0) {
7866 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7867 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
7868 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_6 = 1;
7869 if (unlikely(__pyx_t_6 != -1)) {
7870 __Pyx_RaiseBufferIndexError(__pyx_t_6);
7871 __PYX_ERR(0, 267, __pyx_L1_error)
7873 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_17;
7886 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7889 __Pyx_XDECREF(__pyx_t_10);
7890 __Pyx_XDECREF(__pyx_t_11);
7891 __Pyx_XDECREF(__pyx_t_12);
7892 __Pyx_XDECREF(__pyx_t_13);
7893 __Pyx_XDECREF(__pyx_t_14);
7894 __Pyx_XDECREF(__pyx_t_15);
7895 __Pyx_XDECREF(__pyx_t_16);
7896 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7897 __Pyx_PyThreadState_declare
7898 __Pyx_PyThreadState_assign
7899 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7900 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7901 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7902 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7903 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7904 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7905 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7909 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7910 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7911 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7912 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7914 __Pyx_XGIVEREF(__pyx_r);
7915 __Pyx_RefNannyFinishContext();
7928 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7929 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7930 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
7931 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7934 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7935 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7936 PyArrayObject *__pyx_v_x = 0;
7937 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7938 PyObject *__pyx_v_material_functions = 0;
7939 int __pyx_lineno = 0;
7940 const char *__pyx_filename = NULL;
7941 int __pyx_clineno = 0;
7942 PyObject *__pyx_r = 0;
7943 __Pyx_RefNannyDeclarations
7944 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7946 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7947 PyObject* values[7] = {0,0,0,0,0,0,0};
7948 if (unlikely(__pyx_kwds)) {
7950 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7952 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7954 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7956 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7958 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7960 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7962 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7964 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7967 default:
goto __pyx_L5_argtuple_error;
7969 kw_args = PyDict_Size(__pyx_kwds);
7972 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7973 else goto __pyx_L5_argtuple_error;
7976 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7978 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
7982 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7984 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
7988 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7990 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
7994 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7996 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
8000 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
8002 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
8006 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
8008 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
8011 if (unlikely(kw_args > 0)) {
8012 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
8014 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
8015 goto __pyx_L5_argtuple_error;
8017 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8018 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8019 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8020 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8021 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8022 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8023 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8025 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
8026 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
8027 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
8028 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
8029 __pyx_v_x = ((PyArrayObject *)values[4]);
8030 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
8031 __pyx_v_material_functions = ((PyObject*)values[6]);
8033 goto __pyx_L4_argument_unpacking_done;
8034 __pyx_L5_argtuple_error:;
8035 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
8037 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8038 __Pyx_RefNannyFinishContext();
8040 __pyx_L4_argument_unpacking_done:;
8041 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
8042 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
8043 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
8044 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
8045 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
8046 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
8053 __Pyx_RefNannyFinishContext();
8057 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
8060 int __pyx_v_material_left;
8061 int __pyx_v_material_right;
8064 double __pyx_v_numer;
8065 double __pyx_v_denom;
8066 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
8067 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
8068 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
8069 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
8070 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
8071 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
8072 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
8073 __Pyx_Buffer __pyx_pybuffer_x;
8074 PyObject *__pyx_r = NULL;
8075 __Pyx_RefNannyDeclarations
8079 Py_ssize_t __pyx_t_4;
8080 Py_ssize_t __pyx_t_5;
8090 PyObject *__pyx_t_15 = NULL;
8091 PyObject *__pyx_t_16 = NULL;
8092 PyObject *__pyx_t_17 = NULL;
8093 PyObject *__pyx_t_18 = NULL;
8094 PyObject *__pyx_t_19 = NULL;
8096 PyObject *__pyx_t_21 = NULL;
8097 PyObject *__pyx_t_22 = NULL;
8099 Py_ssize_t __pyx_t_24;
8100 int __pyx_lineno = 0;
8101 const char *__pyx_filename = NULL;
8102 int __pyx_clineno = 0;
8103 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
8104 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
8105 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
8106 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
8107 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
8108 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
8109 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
8110 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
8111 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
8112 __pyx_pybuffer_x.pybuffer.buf = NULL;
8113 __pyx_pybuffer_x.refcount = 0;
8114 __pyx_pybuffernd_x.data = NULL;
8115 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
8116 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
8117 __pyx_pybuffer_ebq_global_vals.refcount = 0;
8118 __pyx_pybuffernd_ebq_global_vals.data = NULL;
8119 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
8121 __Pyx_BufFmt_StackElem __pyx_stack[1];
8122 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8124 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
8126 __Pyx_BufFmt_StackElem __pyx_stack[1];
8127 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8129 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
8131 __Pyx_BufFmt_StackElem __pyx_stack[1];
8132 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8134 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
8136 __Pyx_BufFmt_StackElem __pyx_stack[1];
8137 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
8139 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
8148 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
8149 __pyx_t_2 = __pyx_t_1;
8150 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8151 __pyx_v_ebN = __pyx_t_3;
8160 __pyx_t_4 = __pyx_v_ebN;
8163 if (__pyx_t_4 < 0) {
8164 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8165 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 0;
8166 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8167 if (__pyx_t_5 < 0) {
8168 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8169 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 1;
8170 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8171 if (unlikely(__pyx_t_6 != -1)) {
8172 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8173 __PYX_ERR(0, 289, __pyx_L1_error)
8175 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8184 __pyx_t_5 = __pyx_v_ebN;
8187 if (__pyx_t_5 < 0) {
8188 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
8189 if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
8190 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_6 = 0;
8191 if (__pyx_t_4 < 0) {
8192 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
8193 if (unlikely(__pyx_t_4 < 0)) __pyx_t_6 = 1;
8194 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_6 = 1;
8195 if (unlikely(__pyx_t_6 != -1)) {
8196 __Pyx_RaiseBufferIndexError(__pyx_t_6);
8197 __PYX_ERR(0, 290, __pyx_L1_error)
8199 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
8208 __pyx_t_7 = (__pyx_v_x->dimensions[1]);
8209 __pyx_t_8 = __pyx_t_7;
8210 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_8; __pyx_t_6+=1) {
8211 __pyx_v_k = __pyx_t_6;
8220 __pyx_t_9 = __pyx_v_nd;
8221 __pyx_t_10 = __pyx_t_9;
8222 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
8223 __pyx_v_I = __pyx_t_11;
8232 __pyx_t_12 = __pyx_v_nd;
8233 __pyx_t_13 = __pyx_t_12;
8234 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8235 __pyx_v_J = __pyx_t_14;
8244 if (unlikely(__pyx_v_material_functions == Py_None)) {
8245 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8246 __PYX_ERR(0, 294, __pyx_L1_error)
8248 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8249 __Pyx_GOTREF(__pyx_t_16);
8250 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8251 __Pyx_GOTREF(__pyx_t_17);
8252 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8253 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8254 __Pyx_GOTREF(__pyx_t_16);
8255 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8256 __Pyx_GOTREF(__pyx_t_18);
8257 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8258 __Pyx_GOTREF(__pyx_t_19);
8259 __Pyx_GIVEREF(__pyx_t_16);
8260 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_16);
8261 __Pyx_GIVEREF(__pyx_t_18);
8262 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_18);
8265 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8266 __Pyx_GOTREF(__pyx_t_18);
8267 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8268 __pyx_t_19 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8269 __Pyx_GOTREF(__pyx_t_19);
8272 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8273 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_17);
8274 if (likely(__pyx_t_16)) {
8275 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8276 __Pyx_INCREF(__pyx_t_16);
8277 __Pyx_INCREF(
function);
8278 __Pyx_DECREF_SET(__pyx_t_17,
function);
8282 #if CYTHON_FAST_PYCALL
8283 if (PyFunction_Check(__pyx_t_17)) {
8284 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8285 __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8286 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8287 __Pyx_GOTREF(__pyx_t_15);
8288 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8289 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8292 #if CYTHON_FAST_PYCCALL
8293 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8294 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_18, __pyx_t_19};
8295 __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8296 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8297 __Pyx_GOTREF(__pyx_t_15);
8298 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8299 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8303 __pyx_t_21 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8304 __Pyx_GOTREF(__pyx_t_21);
8306 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_16); __pyx_t_16 = NULL;
8308 __Pyx_GIVEREF(__pyx_t_18);
8309 PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_20, __pyx_t_18);
8310 __Pyx_GIVEREF(__pyx_t_19);
8311 PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_20, __pyx_t_19);
8314 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_21, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8315 __Pyx_GOTREF(__pyx_t_15);
8316 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8318 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8319 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8320 __Pyx_GOTREF(__pyx_t_17);
8321 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8322 __Pyx_GOTREF(__pyx_t_21);
8323 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8324 __Pyx_GOTREF(__pyx_t_19);
8325 __Pyx_GIVEREF(__pyx_t_17);
8326 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17);
8327 __Pyx_GIVEREF(__pyx_t_21);
8328 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
8331 __pyx_t_21 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8332 __Pyx_GOTREF(__pyx_t_21);
8333 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8334 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8335 __pyx_t_19 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
8336 __Pyx_GOTREF(__pyx_t_19);
8337 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8338 if (unlikely(__pyx_v_material_functions == Py_None)) {
8339 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8340 __PYX_ERR(0, 294, __pyx_L1_error)
8342 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8343 __Pyx_GOTREF(__pyx_t_15);
8344 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8345 __Pyx_GOTREF(__pyx_t_17);
8346 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8347 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
8348 __Pyx_GOTREF(__pyx_t_15);
8349 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8350 __Pyx_GOTREF(__pyx_t_18);
8351 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8352 __Pyx_GOTREF(__pyx_t_16);
8353 __Pyx_GIVEREF(__pyx_t_15);
8354 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
8355 __Pyx_GIVEREF(__pyx_t_18);
8356 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
8359 __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_16);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 294, __pyx_L1_error)
8360 __Pyx_GOTREF(__pyx_t_18);
8361 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8362 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8363 __Pyx_GOTREF(__pyx_t_16);
8366 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8367 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
8368 if (likely(__pyx_t_15)) {
8369 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8370 __Pyx_INCREF(__pyx_t_15);
8371 __Pyx_INCREF(
function);
8372 __Pyx_DECREF_SET(__pyx_t_17,
function);
8376 #if CYTHON_FAST_PYCALL
8377 if (PyFunction_Check(__pyx_t_17)) {
8378 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8379 __pyx_t_21 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8380 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8381 __Pyx_GOTREF(__pyx_t_21);
8382 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8383 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8386 #if CYTHON_FAST_PYCCALL
8387 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8388 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_18, __pyx_t_16};
8389 __pyx_t_21 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8390 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
8391 __Pyx_GOTREF(__pyx_t_21);
8392 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8393 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8397 __pyx_t_22 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8398 __Pyx_GOTREF(__pyx_t_22);
8400 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_15); __pyx_t_15 = NULL;
8402 __Pyx_GIVEREF(__pyx_t_18);
8403 PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_20, __pyx_t_18);
8404 __Pyx_GIVEREF(__pyx_t_16);
8405 PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_20, __pyx_t_16);
8408 __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_22, NULL);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 294, __pyx_L1_error)
8409 __Pyx_GOTREF(__pyx_t_21);
8410 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8412 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8413 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
8414 __Pyx_GOTREF(__pyx_t_17);
8415 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8416 __Pyx_GOTREF(__pyx_t_22);
8417 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8418 __Pyx_GOTREF(__pyx_t_16);
8419 __Pyx_GIVEREF(__pyx_t_17);
8420 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
8421 __Pyx_GIVEREF(__pyx_t_22);
8422 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_22);
8425 __pyx_t_22 = __Pyx_PyObject_GetItem(__pyx_t_21, __pyx_t_16);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 294, __pyx_L1_error)
8426 __Pyx_GOTREF(__pyx_t_22);
8427 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8428 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8429 __pyx_t_16 = PyNumber_Multiply(__pyx_t_19, __pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
8430 __Pyx_GOTREF(__pyx_t_16);
8431 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8432 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8433 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_16);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
8434 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8435 __pyx_v_numer = __pyx_t_23;
8444 if (unlikely(__pyx_v_material_functions == Py_None)) {
8445 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8446 __PYX_ERR(0, 295, __pyx_L1_error)
8448 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8449 __Pyx_GOTREF(__pyx_t_22);
8450 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_22);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8451 __Pyx_GOTREF(__pyx_t_19);
8452 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8453 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8454 __Pyx_GOTREF(__pyx_t_22);
8455 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8456 __Pyx_GOTREF(__pyx_t_21);
8457 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8458 __Pyx_GOTREF(__pyx_t_17);
8459 __Pyx_GIVEREF(__pyx_t_22);
8460 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_22);
8461 __Pyx_GIVEREF(__pyx_t_21);
8462 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_21);
8465 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8466 __Pyx_GOTREF(__pyx_t_21);
8467 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8468 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8469 __Pyx_GOTREF(__pyx_t_17);
8472 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8473 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_19);
8474 if (likely(__pyx_t_22)) {
8475 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8476 __Pyx_INCREF(__pyx_t_22);
8477 __Pyx_INCREF(
function);
8478 __Pyx_DECREF_SET(__pyx_t_19,
function);
8482 #if CYTHON_FAST_PYCALL
8483 if (PyFunction_Check(__pyx_t_19)) {
8484 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8485 __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8486 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8487 __Pyx_GOTREF(__pyx_t_16);
8488 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8489 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8492 #if CYTHON_FAST_PYCCALL
8493 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8494 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_t_21, __pyx_t_17};
8495 __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8496 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
8497 __Pyx_GOTREF(__pyx_t_16);
8498 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8499 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8503 __pyx_t_18 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8504 __Pyx_GOTREF(__pyx_t_18);
8506 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_22); __pyx_t_22 = NULL;
8508 __Pyx_GIVEREF(__pyx_t_21);
8509 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_20, __pyx_t_21);
8510 __Pyx_GIVEREF(__pyx_t_17);
8511 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_20, __pyx_t_17);
8514 __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8515 __Pyx_GOTREF(__pyx_t_16);
8516 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8518 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8519 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8520 __Pyx_GOTREF(__pyx_t_19);
8521 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8522 __Pyx_GOTREF(__pyx_t_18);
8523 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8524 __Pyx_GOTREF(__pyx_t_17);
8525 __Pyx_GIVEREF(__pyx_t_19);
8526 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_19);
8527 __Pyx_GIVEREF(__pyx_t_18);
8528 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
8531 __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 295, __pyx_L1_error)
8532 __Pyx_GOTREF(__pyx_t_18);
8533 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8534 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8535 if (unlikely(__pyx_v_material_functions == Py_None)) {
8536 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8537 __PYX_ERR(0, 295, __pyx_L1_error)
8539 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8540 __Pyx_GOTREF(__pyx_t_16);
8541 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8542 __Pyx_GOTREF(__pyx_t_19);
8543 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8544 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8545 __Pyx_GOTREF(__pyx_t_16);
8546 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8547 __Pyx_GOTREF(__pyx_t_21);
8548 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8549 __Pyx_GOTREF(__pyx_t_22);
8550 __Pyx_GIVEREF(__pyx_t_16);
8551 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_16);
8552 __Pyx_GIVEREF(__pyx_t_21);
8553 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_21);
8556 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 295, __pyx_L1_error)
8557 __Pyx_GOTREF(__pyx_t_21);
8558 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8559 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8560 __Pyx_GOTREF(__pyx_t_22);
8563 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
8564 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_19);
8565 if (likely(__pyx_t_16)) {
8566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
8567 __Pyx_INCREF(__pyx_t_16);
8568 __Pyx_INCREF(
function);
8569 __Pyx_DECREF_SET(__pyx_t_19,
function);
8573 #if CYTHON_FAST_PYCALL
8574 if (PyFunction_Check(__pyx_t_19)) {
8575 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8576 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8577 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8578 __Pyx_GOTREF(__pyx_t_17);
8579 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8580 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8583 #if CYTHON_FAST_PYCCALL
8584 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
8585 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_21, __pyx_t_22};
8586 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_20, 2+__pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8587 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
8588 __Pyx_GOTREF(__pyx_t_17);
8589 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
8590 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8594 __pyx_t_15 = PyTuple_New(2+__pyx_t_20);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8595 __Pyx_GOTREF(__pyx_t_15);
8597 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16); __pyx_t_16 = NULL;
8599 __Pyx_GIVEREF(__pyx_t_21);
8600 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_20, __pyx_t_21);
8601 __Pyx_GIVEREF(__pyx_t_22);
8602 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_20, __pyx_t_22);
8605 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8606 __Pyx_GOTREF(__pyx_t_17);
8607 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8609 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8610 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8611 __Pyx_GOTREF(__pyx_t_19);
8612 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8613 __Pyx_GOTREF(__pyx_t_15);
8614 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8615 __Pyx_GOTREF(__pyx_t_22);
8616 __Pyx_GIVEREF(__pyx_t_19);
8617 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19);
8618 __Pyx_GIVEREF(__pyx_t_15);
8619 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_15);
8622 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_22);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8623 __Pyx_GOTREF(__pyx_t_15);
8624 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8625 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8626 __pyx_t_22 = PyNumber_Add(__pyx_t_18, __pyx_t_15);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 295, __pyx_L1_error)
8627 __Pyx_GOTREF(__pyx_t_22);
8628 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
8629 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8630 __pyx_t_15 = __Pyx_PyFloat_AddObjC(__pyx_t_22, __pyx_float_1_0eneg_20, 1.0e-20, 0, 0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8631 __Pyx_GOTREF(__pyx_t_15);
8632 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
8633 __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_23 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8634 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8635 __pyx_v_denom = __pyx_t_23;
8644 if (unlikely(__pyx_v_denom == 0)) {
8645 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8646 __PYX_ERR(0, 296, __pyx_L1_error)
8648 __pyx_t_4 = __pyx_v_ebN;
8649 __pyx_t_5 = __pyx_v_k;
8650 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8652 if (__pyx_t_4 < 0) {
8653 __pyx_t_4 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8654 if (unlikely(__pyx_t_4 < 0)) __pyx_t_20 = 0;
8655 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_20 = 0;
8656 if (__pyx_t_5 < 0) {
8657 __pyx_t_5 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8658 if (unlikely(__pyx_t_5 < 0)) __pyx_t_20 = 1;
8659 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_20 = 1;
8660 if (__pyx_t_24 < 0) {
8661 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8662 if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 2;
8663 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_20 = 2;
8664 if (unlikely(__pyx_t_20 != -1)) {
8665 __Pyx_RaiseBufferIndexError(__pyx_t_20);
8666 __PYX_ERR(0, 296, __pyx_L1_error)
8668 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8683 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8686 __Pyx_XDECREF(__pyx_t_15);
8687 __Pyx_XDECREF(__pyx_t_16);
8688 __Pyx_XDECREF(__pyx_t_17);
8689 __Pyx_XDECREF(__pyx_t_18);
8690 __Pyx_XDECREF(__pyx_t_19);
8691 __Pyx_XDECREF(__pyx_t_21);
8692 __Pyx_XDECREF(__pyx_t_22);
8693 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8694 __Pyx_PyThreadState_declare
8695 __Pyx_PyThreadState_assign
8696 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8697 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8698 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8699 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8700 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8701 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8702 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8706 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8707 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8708 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8709 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8711 __Pyx_XGIVEREF(__pyx_r);
8712 __Pyx_RefNannyFinishContext();
8725 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8726 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8727 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8728 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8730 PyArrayObject *__pyx_v_gravity = 0;
8731 PyArrayObject *__pyx_v_rowptr = 0;
8732 PyArrayObject *__pyx_v_colind = 0;
8733 PyArrayObject *__pyx_v_KWs = 0;
8735 int __pyx_v_nElements_global;
8736 int __pyx_v_nElementBoundaries_element;
8737 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8738 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8739 PyArrayObject *__pyx_v_q_flin = 0;
8740 PyArrayObject *__pyx_v_q_alin = 0;
8741 int __pyx_lineno = 0;
8742 const char *__pyx_filename = NULL;
8743 int __pyx_clineno = 0;
8744 PyObject *__pyx_r = 0;
8745 __Pyx_RefNannyDeclarations
8746 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8748 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8749 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8750 if (unlikely(__pyx_kwds)) {
8752 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8754 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8756 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8758 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8760 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8762 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8764 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8766 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8768 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8770 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8772 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8774 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8776 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8779 default:
goto __pyx_L5_argtuple_error;
8781 kw_args = PyDict_Size(__pyx_kwds);
8784 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8785 else goto __pyx_L5_argtuple_error;
8788 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8790 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8794 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8796 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8800 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8802 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8806 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8808 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8812 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8814 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8818 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8820 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8824 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8826 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8830 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8832 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8836 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8838 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8842 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8844 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8848 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8850 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8853 if (unlikely(kw_args > 0)) {
8854 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8856 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8857 goto __pyx_L5_argtuple_error;
8859 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8860 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8861 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8862 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8863 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8864 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8865 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8866 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8867 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8868 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8869 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8870 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8872 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8873 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8874 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8875 __pyx_v_colind = ((PyArrayObject *)values[3]);
8876 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8877 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8878 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8879 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8880 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8881 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8882 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8883 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8885 goto __pyx_L4_argument_unpacking_done;
8886 __pyx_L5_argtuple_error:;
8887 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8889 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8890 __Pyx_RefNannyFinishContext();
8892 __pyx_L4_argument_unpacking_done:;
8893 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8894 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8895 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8896 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8897 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8898 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8899 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8900 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8901 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8908 __Pyx_RefNannyFinishContext();
8912 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8914 int __pyx_v_eN_neighbor;
8919 int __pyx_v_matID_neig;
8920 CYTHON_UNUSED
int __pyx_v_nSpace2;
8922 PyArrayObject *__pyx_v_a_eN = 0;
8923 PyArrayObject *__pyx_v_a_neig = 0;
8924 PyArrayObject *__pyx_v_a_avg = 0;
8925 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
8926 __Pyx_Buffer __pyx_pybuffer_KWs;
8927 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
8928 __Pyx_Buffer __pyx_pybuffer_a_avg;
8929 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
8930 __Pyx_Buffer __pyx_pybuffer_a_eN;
8931 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
8932 __Pyx_Buffer __pyx_pybuffer_a_neig;
8933 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
8934 __Pyx_Buffer __pyx_pybuffer_colind;
8935 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
8936 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
8937 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
8938 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
8939 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
8940 __Pyx_Buffer __pyx_pybuffer_gravity;
8941 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
8942 __Pyx_Buffer __pyx_pybuffer_q_alin;
8943 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
8944 __Pyx_Buffer __pyx_pybuffer_q_flin;
8945 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
8946 __Pyx_Buffer __pyx_pybuffer_rowptr;
8947 PyObject *__pyx_r = NULL;
8948 __Pyx_RefNannyDeclarations
8949 Py_ssize_t __pyx_t_1;
8951 PyObject *__pyx_t_3 = NULL;
8952 PyObject *__pyx_t_4 = NULL;
8953 PyObject *__pyx_t_5 = NULL;
8954 PyObject *__pyx_t_6 = NULL;
8955 PyObject *__pyx_t_7 = NULL;
8956 PyArrayObject *__pyx_t_8 = NULL;
8957 PyArrayObject *__pyx_t_9 = NULL;
8958 PyArrayObject *__pyx_t_10 = NULL;
8964 Py_ssize_t __pyx_t_16;
8966 Py_ssize_t __pyx_t_18;
8971 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_23;
8972 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_24;
8973 Py_ssize_t __pyx_t_25;
8974 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_26;
8975 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_27;
8977 Py_ssize_t __pyx_t_29;
8978 Py_ssize_t __pyx_t_30;
8979 Py_ssize_t __pyx_t_31;
8980 int __pyx_lineno = 0;
8981 const char *__pyx_filename = NULL;
8982 int __pyx_clineno = 0;
8983 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
8984 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
8985 __pyx_pybuffer_a_eN.refcount = 0;
8986 __pyx_pybuffernd_a_eN.data = NULL;
8987 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
8988 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
8989 __pyx_pybuffer_a_neig.refcount = 0;
8990 __pyx_pybuffernd_a_neig.data = NULL;
8991 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
8992 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
8993 __pyx_pybuffer_a_avg.refcount = 0;
8994 __pyx_pybuffernd_a_avg.data = NULL;
8995 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
8996 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
8997 __pyx_pybuffer_gravity.refcount = 0;
8998 __pyx_pybuffernd_gravity.data = NULL;
8999 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
9000 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
9001 __pyx_pybuffer_rowptr.refcount = 0;
9002 __pyx_pybuffernd_rowptr.data = NULL;
9003 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
9004 __pyx_pybuffer_colind.pybuffer.buf = NULL;
9005 __pyx_pybuffer_colind.refcount = 0;
9006 __pyx_pybuffernd_colind.data = NULL;
9007 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
9008 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
9009 __pyx_pybuffer_KWs.refcount = 0;
9010 __pyx_pybuffernd_KWs.data = NULL;
9011 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
9012 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
9013 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9014 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9015 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9016 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9017 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9018 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9019 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9020 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
9021 __pyx_pybuffer_q_flin.refcount = 0;
9022 __pyx_pybuffernd_q_flin.data = NULL;
9023 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
9024 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
9025 __pyx_pybuffer_q_alin.refcount = 0;
9026 __pyx_pybuffernd_q_alin.data = NULL;
9027 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
9029 __Pyx_BufFmt_StackElem __pyx_stack[1];
9030 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9032 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9034 __Pyx_BufFmt_StackElem __pyx_stack[1];
9035 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9037 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
9039 __Pyx_BufFmt_StackElem __pyx_stack[1];
9040 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9042 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
9044 __Pyx_BufFmt_StackElem __pyx_stack[1];
9045 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9047 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
9049 __Pyx_BufFmt_StackElem __pyx_stack[1];
9050 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9052 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9054 __Pyx_BufFmt_StackElem __pyx_stack[1];
9055 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9057 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9059 __Pyx_BufFmt_StackElem __pyx_stack[1];
9060 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9062 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
9064 __Pyx_BufFmt_StackElem __pyx_stack[1];
9065 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
9067 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
9076 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
9085 __pyx_t_1 = __pyx_v_nSpace;
9087 if (__pyx_t_1 < 0) {
9088 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9089 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
9090 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
9091 if (unlikely(__pyx_t_2 != -1)) {
9092 __Pyx_RaiseBufferIndexError(__pyx_t_2);
9093 __PYX_ERR(0, 329, __pyx_L1_error)
9095 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9104 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9105 __Pyx_GOTREF(__pyx_t_4);
9106 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
9107 __Pyx_GOTREF(__pyx_t_5);
9108 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9109 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
9110 __Pyx_GOTREF(__pyx_t_4);
9113 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9114 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9115 if (likely(__pyx_t_6)) {
9116 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
9117 __Pyx_INCREF(__pyx_t_6);
9118 __Pyx_INCREF(
function);
9119 __Pyx_DECREF_SET(__pyx_t_5,
function);
9123 #if CYTHON_FAST_PYCALL
9124 if (PyFunction_Check(__pyx_t_5)) {
9125 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9126 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9127 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9128 __Pyx_GOTREF(__pyx_t_3);
9129 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9132 #if CYTHON_FAST_PYCCALL
9133 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9134 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
9135 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9136 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9137 __Pyx_GOTREF(__pyx_t_3);
9138 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9142 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
9143 __Pyx_GOTREF(__pyx_t_7);
9145 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9147 __Pyx_GIVEREF(__pyx_t_4);
9148 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
9149 __Pyx_INCREF(__pyx_n_s_d);
9150 __Pyx_GIVEREF(__pyx_n_s_d);
9151 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
9153 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
9154 __Pyx_GOTREF(__pyx_t_3);
9155 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9157 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9158 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
9159 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
9161 __Pyx_BufFmt_StackElem __pyx_stack[1];
9162 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9163 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
9164 __PYX_ERR(0, 331, __pyx_L1_error)
9165 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
9169 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
9179 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9180 __Pyx_GOTREF(__pyx_t_5);
9181 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
9182 __Pyx_GOTREF(__pyx_t_7);
9183 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9184 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
9185 __Pyx_GOTREF(__pyx_t_5);
9188 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9189 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
9190 if (likely(__pyx_t_4)) {
9191 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
9192 __Pyx_INCREF(__pyx_t_4);
9193 __Pyx_INCREF(
function);
9194 __Pyx_DECREF_SET(__pyx_t_7,
function);
9198 #if CYTHON_FAST_PYCALL
9199 if (PyFunction_Check(__pyx_t_7)) {
9200 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9201 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9202 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9203 __Pyx_GOTREF(__pyx_t_3);
9204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9207 #if CYTHON_FAST_PYCCALL
9208 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9209 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
9210 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9211 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9212 __Pyx_GOTREF(__pyx_t_3);
9213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9217 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
9218 __Pyx_GOTREF(__pyx_t_6);
9220 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
9222 __Pyx_GIVEREF(__pyx_t_5);
9223 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
9224 __Pyx_INCREF(__pyx_n_s_d);
9225 __Pyx_GIVEREF(__pyx_n_s_d);
9226 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
9228 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
9229 __Pyx_GOTREF(__pyx_t_3);
9230 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9232 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9233 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
9234 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
9236 __Pyx_BufFmt_StackElem __pyx_stack[1];
9237 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9238 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
9239 __PYX_ERR(0, 332, __pyx_L1_error)
9240 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
9244 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
9254 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_t_7);
9256 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
9257 __Pyx_GOTREF(__pyx_t_6);
9258 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9259 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
9260 __Pyx_GOTREF(__pyx_t_7);
9263 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9264 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9265 if (likely(__pyx_t_5)) {
9266 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
9267 __Pyx_INCREF(__pyx_t_5);
9268 __Pyx_INCREF(
function);
9269 __Pyx_DECREF_SET(__pyx_t_6,
function);
9273 #if CYTHON_FAST_PYCALL
9274 if (PyFunction_Check(__pyx_t_6)) {
9275 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9276 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9277 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9278 __Pyx_GOTREF(__pyx_t_3);
9279 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9282 #if CYTHON_FAST_PYCCALL
9283 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9284 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
9285 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9286 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9287 __Pyx_GOTREF(__pyx_t_3);
9288 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9292 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
9293 __Pyx_GOTREF(__pyx_t_4);
9295 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9297 __Pyx_GIVEREF(__pyx_t_7);
9298 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
9299 __Pyx_INCREF(__pyx_n_s_d);
9300 __Pyx_GIVEREF(__pyx_n_s_d);
9301 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
9303 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
9304 __Pyx_GOTREF(__pyx_t_3);
9305 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9307 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9308 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9309 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
9311 __Pyx_BufFmt_StackElem __pyx_stack[1];
9312 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
9313 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
9314 __PYX_ERR(0, 333, __pyx_L1_error)
9315 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
9319 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
9329 __pyx_t_2 = __pyx_v_nElements_global;
9330 __pyx_t_11 = __pyx_t_2;
9331 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9332 __pyx_v_eN = __pyx_t_12;
9341 __pyx_t_1 = __pyx_v_eN;
9343 if (__pyx_t_1 < 0) {
9344 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9345 if (unlikely(__pyx_t_1 < 0)) __pyx_t_13 = 0;
9346 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_13 = 0;
9347 if (unlikely(__pyx_t_13 != -1)) {
9348 __Pyx_RaiseBufferIndexError(__pyx_t_13);
9349 __PYX_ERR(0, 337, __pyx_L1_error)
9351 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9360 __pyx_t_13 = __pyx_v_nnz;
9361 __pyx_t_14 = __pyx_t_13;
9362 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9363 __pyx_v_ii = __pyx_t_15;
9372 __pyx_t_1 = __pyx_v_matID;
9373 __pyx_t_16 = __pyx_v_ii;
9375 if (__pyx_t_1 < 0) {
9376 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9377 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9378 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_17 = 0;
9379 if (__pyx_t_16 < 0) {
9380 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9381 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
9382 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_17 = 1;
9383 if (unlikely(__pyx_t_17 != -1)) {
9384 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9385 __PYX_ERR(0, 339, __pyx_L1_error)
9387 __pyx_t_18 = __pyx_v_ii;
9389 if (__pyx_t_18 < 0) {
9390 __pyx_t_18 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9391 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
9392 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_17 = 0;
9393 if (unlikely(__pyx_t_17 != -1)) {
9394 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9395 __PYX_ERR(0, 339, __pyx_L1_error)
9397 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9407 __pyx_t_13 = __pyx_v_nElementBoundaries_element;
9408 __pyx_t_14 = __pyx_t_13;
9409 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
9410 __pyx_v_ebN = __pyx_t_15;
9419 __pyx_t_16 = __pyx_v_eN;
9420 __pyx_t_1 = __pyx_v_ebN;
9422 if (__pyx_t_16 < 0) {
9423 __pyx_t_16 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
9424 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 0;
9425 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
9426 if (__pyx_t_1 < 0) {
9427 __pyx_t_1 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
9428 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 1;
9429 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
9430 if (unlikely(__pyx_t_17 != -1)) {
9431 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9432 __PYX_ERR(0, 341, __pyx_L1_error)
9434 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_1, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
9443 __pyx_t_17 = __pyx_v_nnz;
9444 __pyx_t_19 = __pyx_t_17;
9445 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9446 __pyx_v_ii = __pyx_t_20;
9455 __pyx_t_1 = __pyx_v_ii;
9457 if (__pyx_t_1 < 0) {
9458 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9459 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9460 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9461 if (unlikely(__pyx_t_21 != -1)) {
9462 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9463 __PYX_ERR(0, 343, __pyx_L1_error)
9465 __pyx_t_16 = __pyx_v_ii;
9467 if (__pyx_t_16 < 0) {
9468 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9469 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9470 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9471 if (unlikely(__pyx_t_21 != -1)) {
9472 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9473 __PYX_ERR(0, 343, __pyx_L1_error)
9475 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides));
9485 __pyx_t_22 = ((__pyx_v_eN_neighbor >= 0) != 0);
9495 __pyx_t_1 = __pyx_v_eN_neighbor;
9497 if (__pyx_t_1 < 0) {
9498 __pyx_t_1 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9499 if (unlikely(__pyx_t_1 < 0)) __pyx_t_17 = 0;
9500 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_17 = 0;
9501 if (unlikely(__pyx_t_17 != -1)) {
9502 __Pyx_RaiseBufferIndexError(__pyx_t_17);
9503 __PYX_ERR(0, 345, __pyx_L1_error)
9505 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9514 __pyx_t_17 = __pyx_v_nnz;
9515 __pyx_t_19 = __pyx_t_17;
9516 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9517 __pyx_v_ii = __pyx_t_20;
9526 __pyx_t_1 = __pyx_v_matID_neig;
9527 __pyx_t_16 = __pyx_v_ii;
9529 if (__pyx_t_1 < 0) {
9530 __pyx_t_1 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9531 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9532 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_21 = 0;
9533 if (__pyx_t_16 < 0) {
9534 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9535 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 1;
9536 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_21 = 1;
9537 if (unlikely(__pyx_t_21 != -1)) {
9538 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9539 __PYX_ERR(0, 347, __pyx_L1_error)
9541 __pyx_t_18 = __pyx_v_ii;
9543 if (__pyx_t_18 < 0) {
9544 __pyx_t_18 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9545 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9546 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9547 if (unlikely(__pyx_t_21 != -1)) {
9548 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9549 __PYX_ERR(0, 347, __pyx_L1_error)
9551 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9570 __pyx_t_17 = __pyx_v_nnz;
9571 __pyx_t_19 = __pyx_t_17;
9572 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9573 __pyx_v_ii = __pyx_t_20;
9582 __pyx_t_16 = __pyx_v_ii;
9584 if (__pyx_t_16 < 0) {
9585 __pyx_t_16 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9586 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9587 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9588 if (unlikely(__pyx_t_21 != -1)) {
9589 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9590 __PYX_ERR(0, 349, __pyx_L1_error)
9592 __pyx_t_1 = __pyx_v_ii;
9594 if (__pyx_t_1 < 0) {
9595 __pyx_t_1 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9596 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9597 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9598 if (unlikely(__pyx_t_21 != -1)) {
9599 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9600 __PYX_ERR(0, 349, __pyx_L1_error)
9602 __pyx_t_23 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9603 __pyx_t_1 = __pyx_v_ii;
9605 if (__pyx_t_1 < 0) {
9606 __pyx_t_1 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9607 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9608 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_21 = 0;
9609 if (unlikely(__pyx_t_21 != -1)) {
9610 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9611 __PYX_ERR(0, 349, __pyx_L1_error)
9613 __pyx_t_16 = __pyx_v_ii;
9615 if (__pyx_t_16 < 0) {
9616 __pyx_t_16 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9617 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9618 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_21 = 0;
9619 if (unlikely(__pyx_t_21 != -1)) {
9620 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9621 __PYX_ERR(0, 349, __pyx_L1_error)
9623 __pyx_t_24 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9624 if (unlikely(__pyx_t_24 == 0)) {
9625 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9626 __PYX_ERR(0, 349, __pyx_L1_error)
9628 __pyx_t_16 = __pyx_v_ii;
9630 if (__pyx_t_16 < 0) {
9631 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9632 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9633 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9634 if (unlikely(__pyx_t_21 != -1)) {
9635 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9636 __PYX_ERR(0, 349, __pyx_L1_error)
9638 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_23 / __pyx_t_24);
9647 __pyx_t_16 = __pyx_v_ii;
9649 if (__pyx_t_16 < 0) {
9650 __pyx_t_16 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9651 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9652 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_21 = 0;
9653 if (unlikely(__pyx_t_21 != -1)) {
9654 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9655 __PYX_ERR(0, 350, __pyx_L1_error)
9657 __pyx_t_1 = __pyx_v_eN;
9658 __pyx_t_18 = __pyx_v_ebN;
9659 __pyx_t_25 = __pyx_v_ii;
9661 if (__pyx_t_1 < 0) {
9662 __pyx_t_1 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9663 if (unlikely(__pyx_t_1 < 0)) __pyx_t_21 = 0;
9664 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_21 = 0;
9665 if (__pyx_t_18 < 0) {
9666 __pyx_t_18 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9667 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 1;
9668 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_21 = 1;
9669 if (__pyx_t_25 < 0) {
9670 __pyx_t_25 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9671 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 2;
9672 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_21 = 2;
9673 if (unlikely(__pyx_t_21 != -1)) {
9674 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9675 __PYX_ERR(0, 350, __pyx_L1_error)
9677 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9687 __pyx_t_17 = __pyx_v_nSpace;
9688 __pyx_t_19 = __pyx_t_17;
9689 for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
9690 __pyx_v_I = __pyx_t_20;
9699 __pyx_t_16 = __pyx_v_eN;
9700 __pyx_t_25 = __pyx_v_ebN;
9701 __pyx_t_18 = __pyx_v_I;
9703 if (__pyx_t_16 < 0) {
9704 __pyx_t_16 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9705 if (unlikely(__pyx_t_16 < 0)) __pyx_t_21 = 0;
9706 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_21 = 0;
9707 if (__pyx_t_25 < 0) {
9708 __pyx_t_25 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9709 if (unlikely(__pyx_t_25 < 0)) __pyx_t_21 = 1;
9710 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_21 = 1;
9711 if (__pyx_t_18 < 0) {
9712 __pyx_t_18 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9713 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 2;
9714 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_21 = 2;
9715 if (unlikely(__pyx_t_21 != -1)) {
9716 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9717 __PYX_ERR(0, 352, __pyx_L1_error)
9719 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9728 __pyx_t_18 = (__pyx_v_I + 1);
9730 if (__pyx_t_18 < 0) {
9731 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9732 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9733 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9734 if (unlikely(__pyx_t_21 != -1)) {
9735 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9736 __PYX_ERR(0, 353, __pyx_L1_error)
9738 __pyx_t_26 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9739 __pyx_t_18 = __pyx_v_I;
9741 if (__pyx_t_18 < 0) {
9742 __pyx_t_18 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9743 if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0;
9744 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_21 = 0;
9745 if (unlikely(__pyx_t_21 != -1)) {
9746 __Pyx_RaiseBufferIndexError(__pyx_t_21);
9747 __PYX_ERR(0, 353, __pyx_L1_error)
9749 __pyx_t_27 = __pyx_t_26;
9750 for (__pyx_t_21 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_21 < __pyx_t_27; __pyx_t_21+=1) {
9751 __pyx_v_ii = __pyx_t_21;
9760 __pyx_t_25 = __pyx_v_ii;
9762 if (__pyx_t_25 < 0) {
9763 __pyx_t_25 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9764 if (unlikely(__pyx_t_25 < 0)) __pyx_t_28 = 0;
9765 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_28 = 0;
9766 if (unlikely(__pyx_t_28 != -1)) {
9767 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9768 __PYX_ERR(0, 354, __pyx_L1_error)
9770 __pyx_t_16 = __pyx_v_ii;
9772 if (__pyx_t_16 < 0) {
9773 __pyx_t_16 += __pyx_pybuffernd_colind.diminfo[0].shape;
9774 if (unlikely(__pyx_t_16 < 0)) __pyx_t_28 = 0;
9775 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_28 = 0;
9776 if (unlikely(__pyx_t_28 != -1)) {
9777 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9778 __PYX_ERR(0, 354, __pyx_L1_error)
9780 __pyx_t_1 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_colind.diminfo[0].strides));
9782 if (__pyx_t_1 < 0) {
9783 __pyx_t_1 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9784 if (unlikely(__pyx_t_1 < 0)) __pyx_t_28 = 0;
9785 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_28 = 0;
9786 if (unlikely(__pyx_t_28 != -1)) {
9787 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9788 __PYX_ERR(0, 354, __pyx_L1_error)
9790 __pyx_t_29 = __pyx_v_eN;
9791 __pyx_t_30 = __pyx_v_ebN;
9792 __pyx_t_31 = __pyx_v_I;
9794 if (__pyx_t_29 < 0) {
9795 __pyx_t_29 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9796 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
9797 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
9798 if (__pyx_t_30 < 0) {
9799 __pyx_t_30 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9800 if (unlikely(__pyx_t_30 < 0)) __pyx_t_28 = 1;
9801 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
9802 if (__pyx_t_31 < 0) {
9803 __pyx_t_31 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9804 if (unlikely(__pyx_t_31 < 0)) __pyx_t_28 = 2;
9805 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
9806 if (unlikely(__pyx_t_28 != -1)) {
9807 __Pyx_RaiseBufferIndexError(__pyx_t_28);
9808 __PYX_ERR(0, 354, __pyx_L1_error)
9810 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_31, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9825 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9828 __Pyx_XDECREF(__pyx_t_3);
9829 __Pyx_XDECREF(__pyx_t_4);
9830 __Pyx_XDECREF(__pyx_t_5);
9831 __Pyx_XDECREF(__pyx_t_6);
9832 __Pyx_XDECREF(__pyx_t_7);
9833 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9834 __Pyx_PyThreadState_declare
9835 __Pyx_PyThreadState_assign
9836 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9837 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9838 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9839 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9840 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9842 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9843 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9844 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9845 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9846 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9847 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9848 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9849 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9853 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9854 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9855 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9856 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9857 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9858 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9859 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9860 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9861 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9862 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9863 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9865 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9866 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9867 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9868 __Pyx_XGIVEREF(__pyx_r);
9869 __Pyx_RefNannyFinishContext();
9882 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9883 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9884 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9885 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9887 double __pyx_v_beta;
9888 PyArrayObject *__pyx_v_gravity = 0;
9889 PyArrayObject *__pyx_v_alpha = 0;
9890 PyArrayObject *__pyx_v_n = 0;
9891 PyArrayObject *__pyx_v_thetaR = 0;
9892 PyArrayObject *__pyx_v_thetaSR = 0;
9894 int __pyx_v_nElements_global;
9895 int __pyx_v_nElementBoundaries_element;
9896 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9897 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9898 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9899 int __pyx_v_nDOF_trial_element;
9900 PyArrayObject *__pyx_v_u_l2g = 0;
9901 PyArrayObject *__pyx_v_u_dof = 0;
9902 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9903 PyArrayObject *__pyx_v_q_u = 0;
9904 PyArrayObject *__pyx_v_q_mass = 0;
9905 PyArrayObject *__pyx_v_q_dmass = 0;
9906 PyArrayObject *__pyx_v_q_r = 0;
9907 PyArrayObject *__pyx_v_q_kr = 0;
9908 PyArrayObject *__pyx_v_q_dkr = 0;
9909 PyArrayObject *__pyx_v_q_kr_up = 0;
9910 int __pyx_lineno = 0;
9911 const char *__pyx_filename = NULL;
9912 int __pyx_clineno = 0;
9913 PyObject *__pyx_r = 0;
9914 __Pyx_RefNannyDeclarations
9915 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
9917 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
9918 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
9919 if (unlikely(__pyx_kwds)) {
9921 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9923 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9925 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9927 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9929 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9931 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9933 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9935 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9937 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9939 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9941 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9943 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9945 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9947 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9949 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9951 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9953 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9955 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9957 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9959 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9961 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9963 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9965 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9967 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9969 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9972 default:
goto __pyx_L5_argtuple_error;
9974 kw_args = PyDict_Size(__pyx_kwds);
9977 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
9978 else goto __pyx_L5_argtuple_error;
9981 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
9983 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9987 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
9989 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9993 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
9995 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9999 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
10001 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
10003 CYTHON_FALLTHROUGH;
10005 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
10007 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
10009 CYTHON_FALLTHROUGH;
10011 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
10013 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
10015 CYTHON_FALLTHROUGH;
10017 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
10019 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
10021 CYTHON_FALLTHROUGH;
10023 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
10025 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
10027 CYTHON_FALLTHROUGH;
10029 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
10031 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
10033 CYTHON_FALLTHROUGH;
10035 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
10037 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
10039 CYTHON_FALLTHROUGH;
10041 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
10043 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
10045 CYTHON_FALLTHROUGH;
10047 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
10049 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
10051 CYTHON_FALLTHROUGH;
10053 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
10055 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
10057 CYTHON_FALLTHROUGH;
10059 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
10061 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
10063 CYTHON_FALLTHROUGH;
10065 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
10067 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
10069 CYTHON_FALLTHROUGH;
10071 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
10073 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
10075 CYTHON_FALLTHROUGH;
10077 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
10079 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
10081 CYTHON_FALLTHROUGH;
10083 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
10085 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
10087 CYTHON_FALLTHROUGH;
10089 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
10091 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
10093 CYTHON_FALLTHROUGH;
10095 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
10097 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
10099 CYTHON_FALLTHROUGH;
10101 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
10103 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
10105 CYTHON_FALLTHROUGH;
10107 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
10109 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
10111 CYTHON_FALLTHROUGH;
10113 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10115 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
10118 if (unlikely(kw_args > 0)) {
10119 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
10121 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
10122 goto __pyx_L5_argtuple_error;
10124 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10125 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10126 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10127 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10128 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10129 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10130 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10131 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10132 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10133 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10134 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10135 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10136 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10137 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10138 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10139 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10140 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10141 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10142 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10143 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10144 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10145 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
10146 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
10147 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
10149 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
10150 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
10151 __pyx_v_gravity = ((PyArrayObject *)values[2]);
10152 __pyx_v_alpha = ((PyArrayObject *)values[3]);
10153 __pyx_v_n = ((PyArrayObject *)values[4]);
10154 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
10155 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
10156 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
10157 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
10158 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
10159 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
10160 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
10161 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
10162 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
10163 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
10164 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
10165 __pyx_v_q_x = ((PyArrayObject *)values[16]);
10166 __pyx_v_q_u = ((PyArrayObject *)values[17]);
10167 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
10168 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
10169 __pyx_v_q_r = ((PyArrayObject *)values[20]);
10170 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
10171 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
10172 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
10174 goto __pyx_L4_argument_unpacking_done;
10175 __pyx_L5_argtuple_error:;
10176 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
10178 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10179 __Pyx_RefNannyFinishContext();
10181 __pyx_L4_argument_unpacking_done:;
10182 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
10183 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
10184 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
10185 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
10186 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
10187 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
10188 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
10189 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
10190 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
10191 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
10192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
10193 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
10194 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
10195 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
10196 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
10197 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
10198 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
10199 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
10200 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
10207 __Pyx_RefNannyFinishContext();
10211 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
10212 PyObject *__pyx_v_q = NULL;
10213 double __pyx_v_psiC;
10214 double __pyx_v_pcBar;
10215 double __pyx_v_pcBar_n;
10216 double __pyx_v_pcBar_nM1;
10217 double __pyx_v_pcBar_nM2;
10218 double __pyx_v_onePlus_pcBar_n;
10219 double __pyx_v_sBar;
10220 double __pyx_v_sqrt_sBar;
10221 double __pyx_v_DsBar_DpsiC;
10222 double __pyx_v_thetaW;
10223 double __pyx_v_DthetaW_DpsiC;
10224 double __pyx_v_vBar;
10225 double __pyx_v_vBar2;
10226 double __pyx_v_DvBar_DpsiC;
10227 double __pyx_v_KWr;
10228 double __pyx_v_DKWr_DpsiC;
10229 CYTHON_UNUSED
double __pyx_v_rho2;
10230 double __pyx_v_thetaS;
10231 double __pyx_v_rhom;
10232 double __pyx_v_drhom;
10234 double __pyx_v_u_j;
10235 double __pyx_v_u_eN;
10236 double __pyx_v_u_neig;
10237 double __pyx_v_kr_eN;
10238 double __pyx_v_kr_neig;
10239 double __pyx_v_phi_eN;
10240 double __pyx_v_phi_neig;
10242 int __pyx_v_eN_neighbor;
10246 double __pyx_v_nAvgWeight;
10247 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
10248 __Pyx_Buffer __pyx_pybuffer_alpha;
10249 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10250 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10251 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
10252 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
10253 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10254 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10255 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10256 __Pyx_Buffer __pyx_pybuffer_gravity;
10257 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
10258 __Pyx_Buffer __pyx_pybuffer_n;
10259 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
10260 __Pyx_Buffer __pyx_pybuffer_q_dkr;
10261 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
10262 __Pyx_Buffer __pyx_pybuffer_q_dmass;
10263 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10264 __Pyx_Buffer __pyx_pybuffer_q_kr;
10265 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10266 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10267 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
10268 __Pyx_Buffer __pyx_pybuffer_q_mass;
10269 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10270 __Pyx_Buffer __pyx_pybuffer_q_r;
10271 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10272 __Pyx_Buffer __pyx_pybuffer_q_u;
10273 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
10274 __Pyx_Buffer __pyx_pybuffer_q_x;
10275 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
10276 __Pyx_Buffer __pyx_pybuffer_thetaR;
10277 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
10278 __Pyx_Buffer __pyx_pybuffer_thetaSR;
10279 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
10280 __Pyx_Buffer __pyx_pybuffer_u_dof;
10281 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
10282 __Pyx_Buffer __pyx_pybuffer_u_l2g;
10283 PyObject *__pyx_r = NULL;
10284 __Pyx_RefNannyDeclarations
10285 PyObject *__pyx_t_1 = NULL;
10286 PyObject *__pyx_t_2 = NULL;
10287 Py_ssize_t __pyx_t_3;
10288 PyObject *__pyx_t_4 = NULL;
10289 PyObject *__pyx_t_5 = NULL;
10295 Py_ssize_t __pyx_t_11;
10299 Py_ssize_t __pyx_t_15;
10301 Py_ssize_t __pyx_t_17;
10302 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_18;
10303 PyObject *__pyx_t_19 = NULL;
10304 PyObject *__pyx_t_20 = NULL;
10305 int __pyx_lineno = 0;
10306 const char *__pyx_filename = NULL;
10307 int __pyx_clineno = 0;
10308 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
10309 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10310 __pyx_pybuffer_gravity.refcount = 0;
10311 __pyx_pybuffernd_gravity.data = NULL;
10312 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10313 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
10314 __pyx_pybuffer_alpha.refcount = 0;
10315 __pyx_pybuffernd_alpha.data = NULL;
10316 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
10317 __pyx_pybuffer_n.pybuffer.buf = NULL;
10318 __pyx_pybuffer_n.refcount = 0;
10319 __pyx_pybuffernd_n.data = NULL;
10320 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
10321 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
10322 __pyx_pybuffer_thetaR.refcount = 0;
10323 __pyx_pybuffernd_thetaR.data = NULL;
10324 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
10325 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
10326 __pyx_pybuffer_thetaSR.refcount = 0;
10327 __pyx_pybuffernd_thetaSR.data = NULL;
10328 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
10329 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10330 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10331 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10332 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10333 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10334 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10335 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10336 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10337 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
10338 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
10339 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
10340 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
10341 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
10342 __pyx_pybuffer_u_l2g.refcount = 0;
10343 __pyx_pybuffernd_u_l2g.data = NULL;
10344 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
10345 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
10346 __pyx_pybuffer_u_dof.refcount = 0;
10347 __pyx_pybuffernd_u_dof.data = NULL;
10348 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
10349 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
10350 __pyx_pybuffer_q_x.refcount = 0;
10351 __pyx_pybuffernd_q_x.data = NULL;
10352 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
10353 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10354 __pyx_pybuffer_q_u.refcount = 0;
10355 __pyx_pybuffernd_q_u.data = NULL;
10356 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10357 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
10358 __pyx_pybuffer_q_mass.refcount = 0;
10359 __pyx_pybuffernd_q_mass.data = NULL;
10360 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
10361 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
10362 __pyx_pybuffer_q_dmass.refcount = 0;
10363 __pyx_pybuffernd_q_dmass.data = NULL;
10364 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
10365 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10366 __pyx_pybuffer_q_r.refcount = 0;
10367 __pyx_pybuffernd_q_r.data = NULL;
10368 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10369 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10370 __pyx_pybuffer_q_kr.refcount = 0;
10371 __pyx_pybuffernd_q_kr.data = NULL;
10372 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10373 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
10374 __pyx_pybuffer_q_dkr.refcount = 0;
10375 __pyx_pybuffernd_q_dkr.data = NULL;
10376 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
10377 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10378 __pyx_pybuffer_q_kr_up.refcount = 0;
10379 __pyx_pybuffernd_q_kr_up.data = NULL;
10380 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10382 __Pyx_BufFmt_StackElem __pyx_stack[1];
10383 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10385 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10387 __Pyx_BufFmt_StackElem __pyx_stack[1];
10388 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10390 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
10392 __Pyx_BufFmt_StackElem __pyx_stack[1];
10393 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10395 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
10397 __Pyx_BufFmt_StackElem __pyx_stack[1];
10398 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10400 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
10402 __Pyx_BufFmt_StackElem __pyx_stack[1];
10403 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10405 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
10407 __Pyx_BufFmt_StackElem __pyx_stack[1];
10408 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10410 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
10412 __Pyx_BufFmt_StackElem __pyx_stack[1];
10413 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10415 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
10417 __Pyx_BufFmt_StackElem __pyx_stack[1];
10418 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10420 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
10422 __Pyx_BufFmt_StackElem __pyx_stack[1];
10423 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10425 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
10427 __Pyx_BufFmt_StackElem __pyx_stack[1];
10428 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10430 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
10432 __Pyx_BufFmt_StackElem __pyx_stack[1];
10433 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10435 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
10437 __Pyx_BufFmt_StackElem __pyx_stack[1];
10438 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10440 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
10442 __Pyx_BufFmt_StackElem __pyx_stack[1];
10443 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10445 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
10447 __Pyx_BufFmt_StackElem __pyx_stack[1];
10448 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10450 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
10452 __Pyx_BufFmt_StackElem __pyx_stack[1];
10453 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10455 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
10457 __Pyx_BufFmt_StackElem __pyx_stack[1];
10458 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10460 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
10462 __Pyx_BufFmt_StackElem __pyx_stack[1];
10463 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10465 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
10467 __Pyx_BufFmt_StackElem __pyx_stack[1];
10468 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
10470 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
10479 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10480 __Pyx_GOTREF(__pyx_t_1);
10481 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
10482 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
10483 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
10484 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
10485 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
10486 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
10487 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
10488 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
10489 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
10490 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
10491 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
10492 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
10493 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
10494 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
10495 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
10496 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10499 if (__pyx_t_3 >= 5)
break;
10500 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10501 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
10503 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
10504 __Pyx_GOTREF(__pyx_t_1);
10506 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
10516 #ifndef CYTHON_WITHOUT_ASSERTIONS
10517 if (unlikely(!Py_OptimizeFlag)) {
10518 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10519 __Pyx_GOTREF(__pyx_t_1);
10520 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
10521 __Pyx_GOTREF(__pyx_t_4);
10522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10523 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
10524 __Pyx_GOTREF(__pyx_t_1);
10525 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
10526 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10528 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
10529 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10530 if (unlikely(!__pyx_t_6)) {
10531 PyErr_SetNone(PyExc_AssertionError);
10532 __PYX_ERR(0, 400, __pyx_L1_error)
10545 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10554 #ifndef CYTHON_WITHOUT_ASSERTIONS
10555 if (unlikely(!Py_OptimizeFlag)) {
10556 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10557 PyErr_SetNone(PyExc_AssertionError);
10558 __PYX_ERR(0, 401, __pyx_L1_error)
10570 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10579 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10580 if (unlikely(__pyx_t_7 == 0)) {
10581 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10582 __PYX_ERR(0, 409, __pyx_L1_error)
10584 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10593 __pyx_t_8 = __pyx_v_nElements_global;
10594 __pyx_t_9 = __pyx_t_8;
10595 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
10596 __pyx_v_eN = __pyx_t_10;
10605 __pyx_t_11 = __pyx_v_eN;
10607 if (__pyx_t_11 < 0) {
10608 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10609 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
10610 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_12 = 0;
10611 if (unlikely(__pyx_t_12 != -1)) {
10612 __Pyx_RaiseBufferIndexError(__pyx_t_12);
10613 __PYX_ERR(0, 413, __pyx_L1_error)
10615 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10624 __pyx_t_12 = __pyx_v_nDOF_trial_element;
10625 __pyx_t_13 = __pyx_t_12;
10626 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
10627 __pyx_v_j = __pyx_t_14;
10636 __pyx_t_11 = __pyx_v_eN;
10637 __pyx_t_15 = __pyx_v_j;
10639 if (__pyx_t_11 < 0) {
10640 __pyx_t_11 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10641 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10642 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_16 = 0;
10643 if (__pyx_t_15 < 0) {
10644 __pyx_t_15 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10645 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
10646 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_16 = 1;
10647 if (unlikely(__pyx_t_16 != -1)) {
10648 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10649 __PYX_ERR(0, 415, __pyx_L1_error)
10651 __pyx_t_17 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10653 if (__pyx_t_17 < 0) {
10654 __pyx_t_17 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10655 if (unlikely(__pyx_t_17 < 0)) __pyx_t_16 = 0;
10656 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_16 = 0;
10657 if (unlikely(__pyx_t_16 != -1)) {
10658 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10659 __PYX_ERR(0, 415, __pyx_L1_error)
10661 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10670 __pyx_t_15 = __pyx_v_eN;
10671 __pyx_t_11 = __pyx_v_j;
10673 if (__pyx_t_15 < 0) {
10674 __pyx_t_15 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10675 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10676 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_16 = 0;
10677 if (__pyx_t_11 < 0) {
10678 __pyx_t_11 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10679 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
10680 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_16 = 1;
10681 if (unlikely(__pyx_t_16 != -1)) {
10682 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10683 __PYX_ERR(0, 416, __pyx_L1_error)
10685 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10694 __pyx_v_psiC = (-__pyx_v_u_j);
10703 __pyx_t_11 = __pyx_v_matID;
10705 if (__pyx_t_11 < 0) {
10706 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10707 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10708 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10709 if (unlikely(__pyx_t_16 != -1)) {
10710 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10711 __PYX_ERR(0, 420, __pyx_L1_error)
10713 __pyx_t_18 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides));
10714 if (unlikely(__pyx_t_18 == 0)) {
10715 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10716 __PYX_ERR(0, 420, __pyx_L1_error)
10718 __pyx_v_m = (1.0 - (1.0 / __pyx_t_18));
10727 __pyx_t_11 = __pyx_v_matID;
10729 if (__pyx_t_11 < 0) {
10730 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10731 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10732 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
10733 if (unlikely(__pyx_t_16 != -1)) {
10734 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10735 __PYX_ERR(0, 421, __pyx_L1_error)
10737 __pyx_t_15 = __pyx_v_matID;
10739 if (__pyx_t_15 < 0) {
10740 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10741 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10742 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10743 if (unlikely(__pyx_t_16 != -1)) {
10744 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10745 __PYX_ERR(0, 421, __pyx_L1_error)
10747 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10756 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10766 __pyx_t_15 = __pyx_v_matID;
10768 if (__pyx_t_15 < 0) {
10769 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10770 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10771 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10772 if (unlikely(__pyx_t_16 != -1)) {
10773 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10774 __PYX_ERR(0, 423, __pyx_L1_error)
10776 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10785 __pyx_t_15 = __pyx_v_matID;
10787 if (__pyx_t_15 < 0) {
10788 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10789 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10790 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10791 if (unlikely(__pyx_t_16 != -1)) {
10792 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10793 __PYX_ERR(0, 424, __pyx_L1_error)
10795 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10804 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10813 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10822 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10831 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10840 __pyx_t_15 = __pyx_v_matID;
10842 if (__pyx_t_15 < 0) {
10843 __pyx_t_15 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10844 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10845 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10846 if (unlikely(__pyx_t_16 != -1)) {
10847 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10848 __PYX_ERR(0, 431, __pyx_L1_error)
10850 __pyx_t_11 = __pyx_v_matID;
10852 if (__pyx_t_11 < 0) {
10853 __pyx_t_11 += __pyx_pybuffernd_n.diminfo[0].shape;
10854 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10855 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10856 if (unlikely(__pyx_t_16 != -1)) {
10857 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10858 __PYX_ERR(0, 431, __pyx_L1_error)
10860 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10861 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10862 __PYX_ERR(0, 431, __pyx_L1_error)
10864 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10873 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10882 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10891 __pyx_t_11 = __pyx_v_matID;
10893 if (__pyx_t_11 < 0) {
10894 __pyx_t_11 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10895 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10896 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_16 = 0;
10897 if (unlikely(__pyx_t_16 != -1)) {
10898 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10899 __PYX_ERR(0, 435, __pyx_L1_error)
10901 __pyx_t_15 = __pyx_v_matID;
10903 if (__pyx_t_15 < 0) {
10904 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[0].shape;
10905 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10906 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_16 = 0;
10907 if (unlikely(__pyx_t_16 != -1)) {
10908 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10909 __PYX_ERR(0, 435, __pyx_L1_error)
10911 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
10920 __pyx_t_15 = __pyx_v_matID;
10922 if (__pyx_t_15 < 0) {
10923 __pyx_t_15 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10924 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
10925 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10926 if (unlikely(__pyx_t_16 != -1)) {
10927 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10928 __PYX_ERR(0, 437, __pyx_L1_error)
10930 __pyx_t_11 = __pyx_v_matID;
10932 if (__pyx_t_11 < 0) {
10933 __pyx_t_11 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10934 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10935 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_16 = 0;
10936 if (unlikely(__pyx_t_16 != -1)) {
10937 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10938 __PYX_ERR(0, 437, __pyx_L1_error)
10940 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
10949 __pyx_t_11 = __pyx_v_matID;
10951 if (__pyx_t_11 < 0) {
10952 __pyx_t_11 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10953 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
10954 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_16 = 0;
10955 if (unlikely(__pyx_t_16 != -1)) {
10956 __Pyx_RaiseBufferIndexError(__pyx_t_16);
10957 __PYX_ERR(0, 438, __pyx_L1_error)
10959 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
10968 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
10977 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
10986 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
10987 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10988 __PYX_ERR(0, 442, __pyx_L1_error)
10990 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
11010 __pyx_v_thetaW = __pyx_v_thetaS;
11019 __pyx_v_DthetaW_DpsiC = 0.0;
11037 __pyx_v_DKWr_DpsiC = 0.0;
11048 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
11057 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
11066 __pyx_t_11 = __pyx_v_eN;
11067 __pyx_t_15 = __pyx_v_j;
11069 if (__pyx_t_11 < 0) {
11070 __pyx_t_11 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
11071 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11072 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_16 = 0;
11073 if (__pyx_t_15 < 0) {
11074 __pyx_t_15 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
11075 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11076 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_16 = 1;
11077 if (unlikely(__pyx_t_16 != -1)) {
11078 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11079 __PYX_ERR(0, 451, __pyx_L1_error)
11081 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
11090 __pyx_t_15 = __pyx_v_eN;
11091 __pyx_t_11 = __pyx_v_j;
11093 if (__pyx_t_15 < 0) {
11094 __pyx_t_15 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
11095 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11096 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_16 = 0;
11097 if (__pyx_t_11 < 0) {
11098 __pyx_t_11 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
11099 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11100 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_16 = 1;
11101 if (unlikely(__pyx_t_16 != -1)) {
11102 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11103 __PYX_ERR(0, 452, __pyx_L1_error)
11105 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
11114 __pyx_t_11 = __pyx_v_eN;
11115 __pyx_t_15 = __pyx_v_j;
11117 if (__pyx_t_11 < 0) {
11118 __pyx_t_11 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
11119 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11120 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_16 = 0;
11121 if (__pyx_t_15 < 0) {
11122 __pyx_t_15 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
11123 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11124 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_16 = 1;
11125 if (unlikely(__pyx_t_16 != -1)) {
11126 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11127 __PYX_ERR(0, 454, __pyx_L1_error)
11129 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
11138 __pyx_t_15 = __pyx_v_eN;
11139 __pyx_t_11 = __pyx_v_j;
11141 if (__pyx_t_15 < 0) {
11142 __pyx_t_15 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
11143 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11144 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_16 = 0;
11145 if (__pyx_t_11 < 0) {
11146 __pyx_t_11 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
11147 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11148 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_16 = 1;
11149 if (unlikely(__pyx_t_16 != -1)) {
11150 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11151 __PYX_ERR(0, 455, __pyx_L1_error)
11153 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
11164 __pyx_t_8 = __pyx_v_nElements_global;
11165 __pyx_t_9 = __pyx_t_8;
11166 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
11167 __pyx_v_eN = __pyx_t_10;
11176 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11177 __Pyx_GOTREF(__pyx_t_5);
11178 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11179 __Pyx_GOTREF(__pyx_t_1);
11180 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11181 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11182 __Pyx_GOTREF(__pyx_t_5);
11184 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11185 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11186 if (likely(__pyx_t_4)) {
11187 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11188 __Pyx_INCREF(__pyx_t_4);
11189 __Pyx_INCREF(
function);
11190 __Pyx_DECREF_SET(__pyx_t_1,
function);
11193 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
11194 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11195 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11196 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
11197 __Pyx_GOTREF(__pyx_t_2);
11198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11199 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11200 __Pyx_GOTREF(__pyx_t_1);
11201 __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11202 __Pyx_GOTREF(__pyx_t_5);
11203 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11204 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11205 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_5);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
11206 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11207 __pyx_v_u_eN = __pyx_t_7;
11216 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11217 __Pyx_GOTREF(__pyx_t_1);
11218 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11219 __Pyx_GOTREF(__pyx_t_2);
11220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11221 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11222 __Pyx_GOTREF(__pyx_t_1);
11224 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11225 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
11226 if (likely(__pyx_t_4)) {
11227 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11228 __Pyx_INCREF(__pyx_t_4);
11229 __Pyx_INCREF(
function);
11230 __Pyx_DECREF_SET(__pyx_t_2,
function);
11233 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
11234 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11235 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11236 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_5);
11238 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11239 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
11240 __Pyx_GOTREF(__pyx_t_2);
11241 __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11242 __Pyx_GOTREF(__pyx_t_1);
11243 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11245 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
11246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11247 __pyx_v_kr_eN = __pyx_t_7;
11256 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11257 __Pyx_GOTREF(__pyx_t_1);
11258 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11259 __Pyx_GOTREF(__pyx_t_5);
11260 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11261 __Pyx_GOTREF(__pyx_t_4);
11262 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11263 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11264 __Pyx_GOTREF(__pyx_t_5);
11267 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11268 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_4);
11269 if (likely(__pyx_t_19)) {
11270 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11271 __Pyx_INCREF(__pyx_t_19);
11272 __Pyx_INCREF(
function);
11273 __Pyx_DECREF_SET(__pyx_t_4,
function);
11277 #if CYTHON_FAST_PYCALL
11278 if (PyFunction_Check(__pyx_t_4)) {
11279 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11280 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11281 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11282 __Pyx_GOTREF(__pyx_t_2);
11283 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11286 #if CYTHON_FAST_PYCCALL
11287 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11288 PyObject *__pyx_temp[3] = {__pyx_t_19, ((PyObject *)__pyx_v_gravity), __pyx_t_5};
11289 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11290 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
11291 __Pyx_GOTREF(__pyx_t_2);
11292 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11296 __pyx_t_20 = PyTuple_New(2+__pyx_t_12);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 465, __pyx_L1_error)
11297 __Pyx_GOTREF(__pyx_t_20);
11299 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __pyx_t_19 = NULL;
11301 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11302 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11303 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_12, ((PyObject *)__pyx_v_gravity));
11304 __Pyx_GIVEREF(__pyx_t_5);
11305 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_12, __pyx_t_5);
11307 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11308 __Pyx_GOTREF(__pyx_t_2);
11309 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11311 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11312 __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
11313 __Pyx_GOTREF(__pyx_t_4);
11314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11316 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
11317 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11318 __pyx_v_phi_eN = __pyx_t_7;
11327 __pyx_t_12 = __pyx_v_nElementBoundaries_element;
11328 __pyx_t_13 = __pyx_t_12;
11329 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
11330 __pyx_v_ebN = __pyx_t_14;
11339 __pyx_t_11 = __pyx_v_eN;
11340 __pyx_t_15 = __pyx_v_ebN;
11342 if (__pyx_t_11 < 0) {
11343 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11344 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11345 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11346 if (__pyx_t_15 < 0) {
11347 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11348 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11349 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11350 if (unlikely(__pyx_t_16 != -1)) {
11351 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11352 __PYX_ERR(0, 471, __pyx_L1_error)
11354 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
11363 __pyx_t_15 = __pyx_v_eN;
11364 __pyx_t_11 = __pyx_v_ebN;
11366 if (__pyx_t_15 < 0) {
11367 __pyx_t_15 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
11368 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 0;
11369 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_16 = 0;
11370 if (__pyx_t_11 < 0) {
11371 __pyx_t_11 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
11372 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 1;
11373 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_16 = 1;
11374 if (unlikely(__pyx_t_16 != -1)) {
11375 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11376 __PYX_ERR(0, 472, __pyx_L1_error)
11378 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
11387 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
11397 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11398 __Pyx_GOTREF(__pyx_t_2);
11399 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11400 __Pyx_GOTREF(__pyx_t_1);
11401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11402 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11403 __Pyx_GOTREF(__pyx_t_2);
11405 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11406 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
11407 if (likely(__pyx_t_20)) {
11408 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11409 __Pyx_INCREF(__pyx_t_20);
11410 __Pyx_INCREF(
function);
11411 __Pyx_DECREF_SET(__pyx_t_1,
function);
11414 __pyx_t_4 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
11415 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11417 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
11418 __Pyx_GOTREF(__pyx_t_4);
11419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11420 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11421 __Pyx_GOTREF(__pyx_t_1);
11422 __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11423 __Pyx_GOTREF(__pyx_t_2);
11424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11425 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11426 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
11427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11428 __pyx_v_u_neig = __pyx_t_7;
11437 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11438 __Pyx_GOTREF(__pyx_t_1);
11439 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11440 __Pyx_GOTREF(__pyx_t_4);
11441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11442 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11443 __Pyx_GOTREF(__pyx_t_1);
11445 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11446 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_4);
11447 if (likely(__pyx_t_20)) {
11448 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11449 __Pyx_INCREF(__pyx_t_20);
11450 __Pyx_INCREF(
function);
11451 __Pyx_DECREF_SET(__pyx_t_4,
function);
11454 __pyx_t_2 = (__pyx_t_20) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_20, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1);
11455 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
11456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11457 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11458 __Pyx_GOTREF(__pyx_t_2);
11459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11460 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
11461 __Pyx_GOTREF(__pyx_t_4);
11462 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11463 __Pyx_GOTREF(__pyx_t_1);
11464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11465 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11466 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11468 __pyx_v_kr_neig = __pyx_t_7;
11477 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11478 __Pyx_GOTREF(__pyx_t_1);
11479 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11480 __Pyx_GOTREF(__pyx_t_2);
11481 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11482 __Pyx_GOTREF(__pyx_t_20);
11483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11484 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11485 __Pyx_GOTREF(__pyx_t_2);
11488 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
11489 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_20);
11490 if (likely(__pyx_t_5)) {
11491 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_20);
11492 __Pyx_INCREF(__pyx_t_5);
11493 __Pyx_INCREF(
function);
11494 __Pyx_DECREF_SET(__pyx_t_20,
function);
11498 #if CYTHON_FAST_PYCALL
11499 if (PyFunction_Check(__pyx_t_20)) {
11500 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11501 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11502 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11503 __Pyx_GOTREF(__pyx_t_4);
11504 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11507 #if CYTHON_FAST_PYCCALL
11508 if (__Pyx_PyFastCFunction_Check(__pyx_t_20)) {
11509 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_2};
11510 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_20, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11511 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11512 __Pyx_GOTREF(__pyx_t_4);
11513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11517 __pyx_t_19 = PyTuple_New(2+__pyx_t_16);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 477, __pyx_L1_error)
11518 __Pyx_GOTREF(__pyx_t_19);
11520 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_5); __pyx_t_5 = NULL;
11522 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11523 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11524 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_16, ((PyObject *)__pyx_v_gravity));
11525 __Pyx_GIVEREF(__pyx_t_2);
11526 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_16, __pyx_t_2);
11528 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11529 __Pyx_GOTREF(__pyx_t_4);
11530 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
11532 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11533 __pyx_t_20 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 477, __pyx_L1_error)
11534 __Pyx_GOTREF(__pyx_t_20);
11535 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11536 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11537 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_20);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11538 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
11539 __pyx_v_phi_neig = __pyx_t_7;
11548 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11558 __pyx_t_11 = __pyx_v_eN;
11559 __pyx_t_15 = __pyx_v_ebN;
11561 if (__pyx_t_11 < 0) {
11562 __pyx_t_11 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11563 if (unlikely(__pyx_t_11 < 0)) __pyx_t_16 = 0;
11564 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_16 = 0;
11565 if (__pyx_t_15 < 0) {
11566 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11567 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11568 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_16 = 1;
11569 if (unlikely(__pyx_t_16 != -1)) {
11570 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11571 __PYX_ERR(0, 480, __pyx_L1_error)
11573 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11604 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11607 __Pyx_XDECREF(__pyx_t_1);
11608 __Pyx_XDECREF(__pyx_t_2);
11609 __Pyx_XDECREF(__pyx_t_4);
11610 __Pyx_XDECREF(__pyx_t_5);
11611 __Pyx_XDECREF(__pyx_t_19);
11612 __Pyx_XDECREF(__pyx_t_20);
11613 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11614 __Pyx_PyThreadState_declare
11615 __Pyx_PyThreadState_assign
11616 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11618 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11619 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11620 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11621 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11622 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11623 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11635 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11636 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11646 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11647 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11648 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11649 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11657 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11659 __Pyx_XDECREF(__pyx_v_q);
11660 __Pyx_XGIVEREF(__pyx_r);
11661 __Pyx_RefNannyFinishContext();
11674 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11675 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11676 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11677 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11678 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11679 PyArrayObject *__pyx_v_rowptr = 0;
11680 PyArrayObject *__pyx_v_colind = 0;
11681 int __pyx_v_nSpace;
11682 int __pyx_v_nElements_global;
11683 int __pyx_v_nElementBoundaries_element;
11684 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11685 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11686 int __pyx_v_nDOF_test_element;
11687 PyArrayObject *__pyx_v_q_u = 0;
11688 PyArrayObject *__pyx_v_q_grad_u = 0;
11689 PyArrayObject *__pyx_v_q_grad_w = 0;
11690 PyArrayObject *__pyx_v_q_detJ = 0;
11691 PyArrayObject *__pyx_v_q_m = 0;
11692 PyArrayObject *__pyx_v_q_mt = 0;
11693 PyArrayObject *__pyx_v_q_r = 0;
11694 PyArrayObject *__pyx_v_q_kr = 0;
11695 PyArrayObject *__pyx_v_q_kr_up = 0;
11696 PyArrayObject *__pyx_v_q_flin = 0;
11697 PyArrayObject *__pyx_v_q_alin = 0;
11698 PyArrayObject *__pyx_v_elementResidual = 0;
11699 int __pyx_lineno = 0;
11700 const char *__pyx_filename = NULL;
11701 int __pyx_clineno = 0;
11702 PyObject *__pyx_r = 0;
11703 __Pyx_RefNannyDeclarations
11704 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11706 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11707 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11708 if (unlikely(__pyx_kwds)) {
11709 Py_ssize_t kw_args;
11710 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11711 switch (pos_args) {
11712 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11713 CYTHON_FALLTHROUGH;
11714 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11715 CYTHON_FALLTHROUGH;
11716 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11717 CYTHON_FALLTHROUGH;
11718 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11719 CYTHON_FALLTHROUGH;
11720 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11721 CYTHON_FALLTHROUGH;
11722 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11723 CYTHON_FALLTHROUGH;
11724 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11725 CYTHON_FALLTHROUGH;
11726 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11727 CYTHON_FALLTHROUGH;
11728 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11729 CYTHON_FALLTHROUGH;
11730 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11731 CYTHON_FALLTHROUGH;
11732 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11733 CYTHON_FALLTHROUGH;
11734 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11735 CYTHON_FALLTHROUGH;
11736 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11737 CYTHON_FALLTHROUGH;
11738 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11739 CYTHON_FALLTHROUGH;
11740 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11741 CYTHON_FALLTHROUGH;
11742 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11743 CYTHON_FALLTHROUGH;
11744 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11745 CYTHON_FALLTHROUGH;
11746 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11747 CYTHON_FALLTHROUGH;
11748 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11749 CYTHON_FALLTHROUGH;
11750 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11751 CYTHON_FALLTHROUGH;
11752 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11753 CYTHON_FALLTHROUGH;
11755 default:
goto __pyx_L5_argtuple_error;
11757 kw_args = PyDict_Size(__pyx_kwds);
11758 switch (pos_args) {
11760 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11761 else goto __pyx_L5_argtuple_error;
11762 CYTHON_FALLTHROUGH;
11764 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11766 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11768 CYTHON_FALLTHROUGH;
11770 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11772 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11774 CYTHON_FALLTHROUGH;
11776 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11778 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11780 CYTHON_FALLTHROUGH;
11782 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11784 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11786 CYTHON_FALLTHROUGH;
11788 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11790 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11792 CYTHON_FALLTHROUGH;
11794 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11796 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11798 CYTHON_FALLTHROUGH;
11800 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11802 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11804 CYTHON_FALLTHROUGH;
11806 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11808 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11810 CYTHON_FALLTHROUGH;
11812 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11814 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11816 CYTHON_FALLTHROUGH;
11818 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11820 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11822 CYTHON_FALLTHROUGH;
11824 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11826 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11828 CYTHON_FALLTHROUGH;
11830 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11832 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11834 CYTHON_FALLTHROUGH;
11836 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11838 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11840 CYTHON_FALLTHROUGH;
11842 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11844 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11846 CYTHON_FALLTHROUGH;
11848 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11850 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11852 CYTHON_FALLTHROUGH;
11854 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11856 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11858 CYTHON_FALLTHROUGH;
11860 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11862 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11864 CYTHON_FALLTHROUGH;
11866 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11868 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11870 CYTHON_FALLTHROUGH;
11872 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11874 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11876 CYTHON_FALLTHROUGH;
11878 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11880 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11883 if (unlikely(kw_args > 0)) {
11884 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11886 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11887 goto __pyx_L5_argtuple_error;
11889 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11890 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11891 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11892 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11893 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11894 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11895 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11896 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11897 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11898 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11899 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11900 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11901 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11902 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11903 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11904 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11905 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11906 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11907 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11908 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11909 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11911 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11912 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11913 __pyx_v_colind = ((PyArrayObject *)values[2]);
11914 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
11915 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
11916 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
11917 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
11918 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
11919 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
11920 __pyx_v_q_u = ((PyArrayObject *)values[9]);
11921 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
11922 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
11923 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
11924 __pyx_v_q_m = ((PyArrayObject *)values[13]);
11925 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
11926 __pyx_v_q_r = ((PyArrayObject *)values[15]);
11927 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
11928 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
11929 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
11930 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
11931 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
11933 goto __pyx_L4_argument_unpacking_done;
11934 __pyx_L5_argtuple_error:;
11935 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
11937 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11938 __Pyx_RefNannyFinishContext();
11940 __pyx_L4_argument_unpacking_done:;
11941 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
11942 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
11943 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
11944 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
11945 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
11946 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
11947 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
11948 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
11949 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
11950 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
11951 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
11952 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
11953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
11954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
11955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
11956 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
11957 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
11958 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
11965 __Pyx_RefNannyFinishContext();
11969 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
11970 CYTHON_UNUSED
int __pyx_v_upwindFlag;
11971 PyObject *__pyx_v_q = NULL;
11978 PyArrayObject *__pyx_v_a_up = 0;
11979 PyArrayObject *__pyx_v_f_up = 0;
11980 double __pyx_v_nAvgWeight;
11981 double __pyx_v_weight;
11982 double __pyx_v_volFactor;
11983 double __pyx_v_volume;
11984 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
11985 __Pyx_Buffer __pyx_pybuffer_a_up;
11986 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
11987 __Pyx_Buffer __pyx_pybuffer_colind;
11988 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
11989 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
11990 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
11991 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
11992 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
11993 __Pyx_Buffer __pyx_pybuffer_elementResidual;
11994 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
11995 __Pyx_Buffer __pyx_pybuffer_f_up;
11996 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
11997 __Pyx_Buffer __pyx_pybuffer_gravity;
11998 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
11999 __Pyx_Buffer __pyx_pybuffer_q_alin;
12000 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
12001 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12002 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12003 __Pyx_Buffer __pyx_pybuffer_q_flin;
12004 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12005 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12006 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12007 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12008 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12009 __Pyx_Buffer __pyx_pybuffer_q_kr;
12010 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12011 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12012 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12013 __Pyx_Buffer __pyx_pybuffer_q_m;
12014 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12015 __Pyx_Buffer __pyx_pybuffer_q_mt;
12016 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12017 __Pyx_Buffer __pyx_pybuffer_q_r;
12018 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12019 __Pyx_Buffer __pyx_pybuffer_q_u;
12020 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12021 __Pyx_Buffer __pyx_pybuffer_rowptr;
12022 PyObject *__pyx_r = NULL;
12023 __Pyx_RefNannyDeclarations
12024 PyObject *__pyx_t_1 = NULL;
12025 PyObject *__pyx_t_2 = NULL;
12026 Py_ssize_t __pyx_t_3;
12027 PyObject *__pyx_t_4 = NULL;
12028 PyObject *__pyx_t_5 = NULL;
12030 Py_ssize_t __pyx_t_7;
12032 PyObject *__pyx_t_9 = NULL;
12033 PyArrayObject *__pyx_t_10 = NULL;
12034 PyArrayObject *__pyx_t_11 = NULL;
12038 Py_ssize_t __pyx_t_15;
12043 Py_ssize_t __pyx_t_20;
12044 Py_ssize_t __pyx_t_21;
12051 Py_ssize_t __pyx_t_28;
12052 Py_ssize_t __pyx_t_29;
12053 Py_ssize_t __pyx_t_30;
12054 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_31;
12055 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_32;
12057 Py_ssize_t __pyx_t_34;
12058 Py_ssize_t __pyx_t_35;
12059 Py_ssize_t __pyx_t_36;
12060 Py_ssize_t __pyx_t_37;
12061 Py_ssize_t __pyx_t_38;
12062 int __pyx_lineno = 0;
12063 const char *__pyx_filename = NULL;
12064 int __pyx_clineno = 0;
12065 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
12066 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12067 __pyx_pybuffer_a_up.refcount = 0;
12068 __pyx_pybuffernd_a_up.data = NULL;
12069 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12070 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12071 __pyx_pybuffer_f_up.refcount = 0;
12072 __pyx_pybuffernd_f_up.data = NULL;
12073 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12074 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12075 __pyx_pybuffer_gravity.refcount = 0;
12076 __pyx_pybuffernd_gravity.data = NULL;
12077 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12078 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12079 __pyx_pybuffer_rowptr.refcount = 0;
12080 __pyx_pybuffernd_rowptr.data = NULL;
12081 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12082 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12083 __pyx_pybuffer_colind.refcount = 0;
12084 __pyx_pybuffernd_colind.data = NULL;
12085 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12086 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12087 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12088 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12089 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12090 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12091 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12092 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12093 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12094 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12095 __pyx_pybuffer_q_u.refcount = 0;
12096 __pyx_pybuffernd_q_u.data = NULL;
12097 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12098 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12099 __pyx_pybuffer_q_grad_u.refcount = 0;
12100 __pyx_pybuffernd_q_grad_u.data = NULL;
12101 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12102 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12103 __pyx_pybuffer_q_grad_w.refcount = 0;
12104 __pyx_pybuffernd_q_grad_w.data = NULL;
12105 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12106 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12107 __pyx_pybuffer_q_detJ.refcount = 0;
12108 __pyx_pybuffernd_q_detJ.data = NULL;
12109 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12110 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12111 __pyx_pybuffer_q_m.refcount = 0;
12112 __pyx_pybuffernd_q_m.data = NULL;
12113 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12114 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12115 __pyx_pybuffer_q_mt.refcount = 0;
12116 __pyx_pybuffernd_q_mt.data = NULL;
12117 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12118 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12119 __pyx_pybuffer_q_r.refcount = 0;
12120 __pyx_pybuffernd_q_r.data = NULL;
12121 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12122 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12123 __pyx_pybuffer_q_kr.refcount = 0;
12124 __pyx_pybuffernd_q_kr.data = NULL;
12125 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12126 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12127 __pyx_pybuffer_q_kr_up.refcount = 0;
12128 __pyx_pybuffernd_q_kr_up.data = NULL;
12129 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12130 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12131 __pyx_pybuffer_q_flin.refcount = 0;
12132 __pyx_pybuffernd_q_flin.data = NULL;
12133 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12134 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12135 __pyx_pybuffer_q_alin.refcount = 0;
12136 __pyx_pybuffernd_q_alin.data = NULL;
12137 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12138 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
12139 __pyx_pybuffer_elementResidual.refcount = 0;
12140 __pyx_pybuffernd_elementResidual.data = NULL;
12141 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
12143 __Pyx_BufFmt_StackElem __pyx_stack[1];
12144 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12146 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12148 __Pyx_BufFmt_StackElem __pyx_stack[1];
12149 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12151 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12153 __Pyx_BufFmt_StackElem __pyx_stack[1];
12154 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12156 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12158 __Pyx_BufFmt_StackElem __pyx_stack[1];
12159 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12161 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12163 __Pyx_BufFmt_StackElem __pyx_stack[1];
12164 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12166 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12168 __Pyx_BufFmt_StackElem __pyx_stack[1];
12169 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12171 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12173 __Pyx_BufFmt_StackElem __pyx_stack[1];
12174 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12176 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12178 __Pyx_BufFmt_StackElem __pyx_stack[1];
12179 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12181 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12183 __Pyx_BufFmt_StackElem __pyx_stack[1];
12184 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12186 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12188 __Pyx_BufFmt_StackElem __pyx_stack[1];
12189 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12191 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12193 __Pyx_BufFmt_StackElem __pyx_stack[1];
12194 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12196 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12198 __Pyx_BufFmt_StackElem __pyx_stack[1];
12199 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12201 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12203 __Pyx_BufFmt_StackElem __pyx_stack[1];
12204 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12206 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12208 __Pyx_BufFmt_StackElem __pyx_stack[1];
12209 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12211 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12213 __Pyx_BufFmt_StackElem __pyx_stack[1];
12214 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12216 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12218 __Pyx_BufFmt_StackElem __pyx_stack[1];
12219 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12221 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12223 __Pyx_BufFmt_StackElem __pyx_stack[1];
12224 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
12226 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
12235 __pyx_v_upwindFlag = 1;
12244 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12245 __Pyx_GOTREF(__pyx_t_1);
12246 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12247 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12248 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12249 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12250 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12251 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12252 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12253 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12254 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12255 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12256 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12257 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12258 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12259 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12260 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12261 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12264 if (__pyx_t_3 >= 5)
break;
12265 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12266 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
12268 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
12269 __Pyx_GOTREF(__pyx_t_1);
12271 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12281 #ifndef CYTHON_WITHOUT_ASSERTIONS
12282 if (unlikely(!Py_OptimizeFlag)) {
12283 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12284 __Pyx_GOTREF(__pyx_t_1);
12285 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
12286 __Pyx_GOTREF(__pyx_t_4);
12287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12288 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
12289 __Pyx_GOTREF(__pyx_t_1);
12290 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
12291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12292 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12293 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
12294 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12295 if (unlikely(!__pyx_t_6)) {
12296 PyErr_SetNone(PyExc_AssertionError);
12297 __PYX_ERR(0, 530, __pyx_L1_error)
12310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12319 #ifndef CYTHON_WITHOUT_ASSERTIONS
12320 if (unlikely(!Py_OptimizeFlag)) {
12321 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12322 PyErr_SetNone(PyExc_AssertionError);
12323 __PYX_ERR(0, 531, __pyx_L1_error)
12335 __pyx_t_7 = __pyx_v_nSpace;
12337 if (__pyx_t_7 < 0) {
12338 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12339 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12340 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12341 if (unlikely(__pyx_t_8 != -1)) {
12342 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12343 __PYX_ERR(0, 532, __pyx_L1_error)
12345 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12354 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12355 __Pyx_GOTREF(__pyx_t_5);
12356 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
12357 __Pyx_GOTREF(__pyx_t_1);
12358 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12359 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
12360 __Pyx_GOTREF(__pyx_t_5);
12363 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12364 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12365 if (likely(__pyx_t_4)) {
12366 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12367 __Pyx_INCREF(__pyx_t_4);
12368 __Pyx_INCREF(
function);
12369 __Pyx_DECREF_SET(__pyx_t_1,
function);
12373 #if CYTHON_FAST_PYCALL
12374 if (PyFunction_Check(__pyx_t_1)) {
12375 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12376 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12377 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12378 __Pyx_GOTREF(__pyx_t_2);
12379 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12382 #if CYTHON_FAST_PYCCALL
12383 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
12384 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
12385 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12386 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12387 __Pyx_GOTREF(__pyx_t_2);
12388 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12392 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
12393 __Pyx_GOTREF(__pyx_t_9);
12395 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12397 __Pyx_GIVEREF(__pyx_t_5);
12398 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
12399 __Pyx_INCREF(__pyx_n_s_d);
12400 __Pyx_GIVEREF(__pyx_n_s_d);
12401 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
12403 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
12404 __Pyx_GOTREF(__pyx_t_2);
12405 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12408 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
12409 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12411 __Pyx_BufFmt_StackElem __pyx_stack[1];
12412 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12413 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12414 __PYX_ERR(0, 536, __pyx_L1_error)
12415 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12419 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12429 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12430 __Pyx_GOTREF(__pyx_t_1);
12431 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
12432 __Pyx_GOTREF(__pyx_t_9);
12433 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12434 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
12435 __Pyx_GOTREF(__pyx_t_1);
12438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12439 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12440 if (likely(__pyx_t_5)) {
12441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12442 __Pyx_INCREF(__pyx_t_5);
12443 __Pyx_INCREF(
function);
12444 __Pyx_DECREF_SET(__pyx_t_9,
function);
12448 #if CYTHON_FAST_PYCALL
12449 if (PyFunction_Check(__pyx_t_9)) {
12450 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12451 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12452 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12453 __Pyx_GOTREF(__pyx_t_2);
12454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12457 #if CYTHON_FAST_PYCCALL
12458 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12459 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12460 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12461 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12462 __Pyx_GOTREF(__pyx_t_2);
12463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12467 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12468 __Pyx_GOTREF(__pyx_t_4);
12470 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12472 __Pyx_GIVEREF(__pyx_t_1);
12473 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12474 __Pyx_INCREF(__pyx_n_s_d);
12475 __Pyx_GIVEREF(__pyx_n_s_d);
12476 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12478 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12479 __Pyx_GOTREF(__pyx_t_2);
12480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12482 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12483 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12484 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12486 __Pyx_BufFmt_StackElem __pyx_stack[1];
12487 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12488 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12489 __PYX_ERR(0, 537, __pyx_L1_error)
12490 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12494 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12504 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12505 if (unlikely(__pyx_t_12 == 0)) {
12506 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12507 __PYX_ERR(0, 539, __pyx_L1_error)
12509 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12518 __pyx_v_weight = 1.0;
12519 __pyx_v_volFactor = 1.0;
12528 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12538 __pyx_v_volFactor = 0.5;
12556 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12566 __pyx_v_volFactor = (1.0 / 6.0);
12584 __pyx_t_8 = __pyx_v_nElements_global;
12585 __pyx_t_13 = __pyx_t_8;
12586 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
12587 __pyx_v_eN = __pyx_t_14;
12596 __pyx_t_7 = __pyx_v_eN;
12599 if (__pyx_t_7 < 0) {
12600 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12601 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
12602 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
12603 if (__pyx_t_15 < 0) {
12604 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12605 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
12606 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
12607 if (unlikely(__pyx_t_16 != -1)) {
12608 __Pyx_RaiseBufferIndexError(__pyx_t_16);
12609 __PYX_ERR(0, 547, __pyx_L1_error)
12611 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12620 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12629 __pyx_t_16 = __pyx_v_nDOF_test_element;
12630 __pyx_t_17 = __pyx_t_16;
12631 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
12632 __pyx_v_i = __pyx_t_18;
12641 __pyx_t_15 = __pyx_v_eN;
12642 __pyx_t_7 = __pyx_v_i;
12644 if (__pyx_t_15 < 0) {
12645 __pyx_t_15 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12646 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
12647 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_19 = 0;
12648 if (__pyx_t_7 < 0) {
12649 __pyx_t_7 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12650 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
12651 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_19 = 1;
12652 if (unlikely(__pyx_t_19 != -1)) {
12653 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12654 __PYX_ERR(0, 553, __pyx_L1_error)
12656 __pyx_t_20 = __pyx_v_eN;
12657 __pyx_t_21 = __pyx_v_i;
12659 if (__pyx_t_20 < 0) {
12660 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12661 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
12662 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12663 if (__pyx_t_21 < 0) {
12664 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12665 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
12666 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12667 if (unlikely(__pyx_t_19 != -1)) {
12668 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12669 __PYX_ERR(0, 553, __pyx_L1_error)
12671 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12680 __pyx_t_7 = __pyx_v_eN;
12681 __pyx_t_15 = __pyx_v_i;
12683 if (__pyx_t_7 < 0) {
12684 __pyx_t_7 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12685 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 0;
12686 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_19 = 0;
12687 if (__pyx_t_15 < 0) {
12688 __pyx_t_15 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12689 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 1;
12690 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_19 = 1;
12691 if (unlikely(__pyx_t_19 != -1)) {
12692 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12693 __PYX_ERR(0, 555, __pyx_L1_error)
12695 __pyx_t_21 = __pyx_v_eN;
12696 __pyx_t_20 = __pyx_v_i;
12698 if (__pyx_t_21 < 0) {
12699 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12700 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 0;
12701 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_19 = 0;
12702 if (__pyx_t_20 < 0) {
12703 __pyx_t_20 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12704 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 1;
12705 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_19 = 1;
12706 if (unlikely(__pyx_t_19 != -1)) {
12707 __Pyx_RaiseBufferIndexError(__pyx_t_19);
12708 __PYX_ERR(0, 555, __pyx_L1_error)
12710 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12719 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
12720 __pyx_t_22 = __pyx_t_19;
12721 for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
12722 __pyx_v_ebN = __pyx_t_23;
12731 __pyx_t_24 = __pyx_v_nnz;
12732 __pyx_t_25 = __pyx_t_24;
12733 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12734 __pyx_v_ii = __pyx_t_26;
12743 __pyx_t_15 = __pyx_v_eN;
12744 __pyx_t_7 = __pyx_v_ebN;
12745 __pyx_t_20 = __pyx_v_ii;
12747 if (__pyx_t_15 < 0) {
12748 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12749 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12750 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_27 = 0;
12751 if (__pyx_t_7 < 0) {
12752 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12753 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 1;
12754 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_27 = 1;
12755 if (__pyx_t_20 < 0) {
12756 __pyx_t_20 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12757 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12758 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_27 = 2;
12759 if (unlikely(__pyx_t_27 != -1)) {
12760 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12761 __PYX_ERR(0, 561, __pyx_L1_error)
12763 __pyx_t_21 = __pyx_v_eN;
12764 __pyx_t_28 = __pyx_v_ebN;
12766 if (__pyx_t_21 < 0) {
12767 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12768 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 0;
12769 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12770 if (__pyx_t_28 < 0) {
12771 __pyx_t_28 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12772 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 1;
12773 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12774 if (unlikely(__pyx_t_27 != -1)) {
12775 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12776 __PYX_ERR(0, 561, __pyx_L1_error)
12778 __pyx_t_29 = __pyx_v_ii;
12780 if (__pyx_t_29 < 0) {
12781 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12782 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12783 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_27 = 0;
12784 if (unlikely(__pyx_t_27 != -1)) {
12785 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12786 __PYX_ERR(0, 561, __pyx_L1_error)
12788 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12798 __pyx_t_24 = __pyx_v_nSpace;
12799 __pyx_t_25 = __pyx_t_24;
12800 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12801 __pyx_v_I = __pyx_t_26;
12810 __pyx_t_28 = __pyx_v_eN;
12811 __pyx_t_21 = __pyx_v_ebN;
12812 __pyx_t_20 = __pyx_v_I;
12814 if (__pyx_t_28 < 0) {
12815 __pyx_t_28 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12816 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12817 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_27 = 0;
12818 if (__pyx_t_21 < 0) {
12819 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12820 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 1;
12821 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_27 = 1;
12822 if (__pyx_t_20 < 0) {
12823 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12824 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 2;
12825 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_27 = 2;
12826 if (unlikely(__pyx_t_27 != -1)) {
12827 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12828 __PYX_ERR(0, 563, __pyx_L1_error)
12830 __pyx_t_7 = __pyx_v_eN;
12831 __pyx_t_15 = __pyx_v_ebN;
12833 if (__pyx_t_7 < 0) {
12834 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12835 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12836 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_27 = 0;
12837 if (__pyx_t_15 < 0) {
12838 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12839 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 1;
12840 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_27 = 1;
12841 if (unlikely(__pyx_t_27 != -1)) {
12842 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12843 __PYX_ERR(0, 563, __pyx_L1_error)
12845 __pyx_t_29 = __pyx_v_I;
12847 if (__pyx_t_29 < 0) {
12848 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12849 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12850 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12851 if (unlikely(__pyx_t_27 != -1)) {
12852 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12853 __PYX_ERR(0, 563, __pyx_L1_error)
12855 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12865 __pyx_t_24 = __pyx_v_nSpace;
12866 __pyx_t_25 = __pyx_t_24;
12867 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
12868 __pyx_v_I = __pyx_t_26;
12877 __pyx_t_15 = __pyx_v_I;
12879 if (__pyx_t_15 < 0) {
12880 __pyx_t_15 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12881 if (unlikely(__pyx_t_15 < 0)) __pyx_t_27 = 0;
12882 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_27 = 0;
12883 if (unlikely(__pyx_t_27 != -1)) {
12884 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12885 __PYX_ERR(0, 567, __pyx_L1_error)
12887 __pyx_t_7 = __pyx_v_eN;
12888 __pyx_t_20 = __pyx_v_ebN;
12889 __pyx_t_21 = __pyx_v_i;
12890 __pyx_t_28 = __pyx_v_I;
12892 if (__pyx_t_7 < 0) {
12893 __pyx_t_7 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12894 if (unlikely(__pyx_t_7 < 0)) __pyx_t_27 = 0;
12895 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_27 = 0;
12896 if (__pyx_t_20 < 0) {
12897 __pyx_t_20 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12898 if (unlikely(__pyx_t_20 < 0)) __pyx_t_27 = 1;
12899 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_27 = 1;
12900 if (__pyx_t_21 < 0) {
12901 __pyx_t_21 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12902 if (unlikely(__pyx_t_21 < 0)) __pyx_t_27 = 2;
12903 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_27 = 2;
12904 if (__pyx_t_28 < 0) {
12905 __pyx_t_28 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12906 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 3;
12907 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_27 = 3;
12908 if (unlikely(__pyx_t_27 != -1)) {
12909 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12910 __PYX_ERR(0, 567, __pyx_L1_error)
12912 __pyx_t_29 = __pyx_v_eN;
12913 __pyx_t_30 = __pyx_v_i;
12915 if (__pyx_t_29 < 0) {
12916 __pyx_t_29 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12917 if (unlikely(__pyx_t_29 < 0)) __pyx_t_27 = 0;
12918 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_27 = 0;
12919 if (__pyx_t_30 < 0) {
12920 __pyx_t_30 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12921 if (unlikely(__pyx_t_30 < 0)) __pyx_t_27 = 1;
12922 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_27 = 1;
12923 if (unlikely(__pyx_t_27 != -1)) {
12924 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12925 __PYX_ERR(0, 567, __pyx_L1_error)
12927 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12936 __pyx_t_28 = (__pyx_v_I + 1);
12938 if (__pyx_t_28 < 0) {
12939 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12940 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12941 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
12942 if (unlikely(__pyx_t_27 != -1)) {
12943 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12944 __PYX_ERR(0, 568, __pyx_L1_error)
12946 __pyx_t_31 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12947 __pyx_t_28 = __pyx_v_I;
12949 if (__pyx_t_28 < 0) {
12950 __pyx_t_28 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12951 if (unlikely(__pyx_t_28 < 0)) __pyx_t_27 = 0;
12952 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_27 = 0;
12953 if (unlikely(__pyx_t_27 != -1)) {
12954 __Pyx_RaiseBufferIndexError(__pyx_t_27);
12955 __PYX_ERR(0, 568, __pyx_L1_error)
12957 __pyx_t_32 = __pyx_t_31;
12958 for (__pyx_t_27 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_27 < __pyx_t_32; __pyx_t_27+=1) {
12959 __pyx_v_ii = __pyx_t_27;
12968 __pyx_t_21 = __pyx_v_ii;
12970 if (__pyx_t_21 < 0) {
12971 __pyx_t_21 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12972 if (unlikely(__pyx_t_21 < 0)) __pyx_t_33 = 0;
12973 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
12974 if (unlikely(__pyx_t_33 != -1)) {
12975 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12976 __PYX_ERR(0, 569, __pyx_L1_error)
12978 __pyx_t_20 = __pyx_v_ii;
12980 if (__pyx_t_20 < 0) {
12981 __pyx_t_20 += __pyx_pybuffernd_colind.diminfo[0].shape;
12982 if (unlikely(__pyx_t_20 < 0)) __pyx_t_33 = 0;
12983 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_33 = 0;
12984 if (unlikely(__pyx_t_33 != -1)) {
12985 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12986 __PYX_ERR(0, 569, __pyx_L1_error)
12988 __pyx_t_7 = __pyx_v_eN;
12989 __pyx_t_15 = __pyx_v_ebN;
12990 __pyx_t_30 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_colind.diminfo[0].strides));
12992 if (__pyx_t_7 < 0) {
12993 __pyx_t_7 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
12994 if (unlikely(__pyx_t_7 < 0)) __pyx_t_33 = 0;
12995 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_33 = 0;
12996 if (__pyx_t_15 < 0) {
12997 __pyx_t_15 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
12998 if (unlikely(__pyx_t_15 < 0)) __pyx_t_33 = 1;
12999 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_33 = 1;
13000 if (__pyx_t_30 < 0) {
13001 __pyx_t_30 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
13002 if (unlikely(__pyx_t_30 < 0)) __pyx_t_33 = 2;
13003 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_33 = 2;
13004 if (unlikely(__pyx_t_33 != -1)) {
13005 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13006 __PYX_ERR(0, 569, __pyx_L1_error)
13008 __pyx_t_29 = __pyx_v_eN;
13009 __pyx_t_34 = __pyx_v_ebN;
13010 __pyx_t_35 = __pyx_v_i;
13011 __pyx_t_36 = __pyx_v_I;
13013 if (__pyx_t_29 < 0) {
13014 __pyx_t_29 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13015 if (unlikely(__pyx_t_29 < 0)) __pyx_t_33 = 0;
13016 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
13017 if (__pyx_t_34 < 0) {
13018 __pyx_t_34 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13019 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 1;
13020 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
13021 if (__pyx_t_35 < 0) {
13022 __pyx_t_35 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13023 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 2;
13024 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
13025 if (__pyx_t_36 < 0) {
13026 __pyx_t_36 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13027 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 3;
13028 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
13029 if (unlikely(__pyx_t_33 != -1)) {
13030 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13031 __PYX_ERR(0, 569, __pyx_L1_error)
13033 __pyx_t_37 = __pyx_v_eN;
13034 __pyx_t_38 = __pyx_v_i;
13036 if (__pyx_t_37 < 0) {
13037 __pyx_t_37 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
13038 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 0;
13039 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_33 = 0;
13040 if (__pyx_t_38 < 0) {
13041 __pyx_t_38 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
13042 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 1;
13043 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_33 = 1;
13044 if (unlikely(__pyx_t_33 != -1)) {
13045 __Pyx_RaiseBufferIndexError(__pyx_t_33);
13046 __PYX_ERR(0, 569, __pyx_L1_error)
13048 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_34, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_35, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13064 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13067 __Pyx_XDECREF(__pyx_t_1);
13068 __Pyx_XDECREF(__pyx_t_2);
13069 __Pyx_XDECREF(__pyx_t_4);
13070 __Pyx_XDECREF(__pyx_t_5);
13071 __Pyx_XDECREF(__pyx_t_9);
13072 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13073 __Pyx_PyThreadState_declare
13074 __Pyx_PyThreadState_assign
13075 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13076 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13077 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13078 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13079 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13080 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13081 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13082 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13083 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13084 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13085 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13086 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13087 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13088 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13089 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13090 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13091 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13092 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13093 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13094 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13095 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13096 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
13100 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13101 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13102 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13103 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13104 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
13105 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13106 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13107 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13108 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13109 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13111 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13114 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13115 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13118 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13120 __Pyx_XDECREF(__pyx_v_q);
13121 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13122 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13123 __Pyx_XGIVEREF(__pyx_r);
13124 __Pyx_RefNannyFinishContext();
13137 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13138 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
13139 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
13140 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13141 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
13142 PyArrayObject *__pyx_v_rowptr = 0;
13143 PyArrayObject *__pyx_v_colind = 0;
13144 int __pyx_v_nSpace;
13145 int __pyx_v_nElements_global;
13146 int __pyx_v_nElementBoundaries_element;
13147 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
13148 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
13149 int __pyx_v_nDOF_test_element;
13150 int __pyx_v_nDOF_trial_element;
13151 PyArrayObject *__pyx_v_q_u = 0;
13152 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
13153 PyArrayObject *__pyx_v_q_grad_w = 0;
13154 PyArrayObject *__pyx_v_q_grad_v = 0;
13155 PyArrayObject *__pyx_v_q_detJ = 0;
13156 PyArrayObject *__pyx_v_q_m = 0;
13157 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
13158 PyArrayObject *__pyx_v_q_mt = 0;
13159 PyArrayObject *__pyx_v_q_dmt = 0;
13160 PyArrayObject *__pyx_v_q_r = 0;
13161 PyArrayObject *__pyx_v_q_kr = 0;
13162 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
13163 PyArrayObject *__pyx_v_q_kr_up = 0;
13164 PyArrayObject *__pyx_v_q_flin = 0;
13165 PyArrayObject *__pyx_v_q_alin = 0;
13166 PyArrayObject *__pyx_v_elementJacobian = 0;
13167 int __pyx_lineno = 0;
13168 const char *__pyx_filename = NULL;
13169 int __pyx_clineno = 0;
13170 PyObject *__pyx_r = 0;
13171 __Pyx_RefNannyDeclarations
13172 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
13174 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
13175 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13176 if (unlikely(__pyx_kwds)) {
13177 Py_ssize_t kw_args;
13178 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13179 switch (pos_args) {
13180 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13181 CYTHON_FALLTHROUGH;
13182 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13183 CYTHON_FALLTHROUGH;
13184 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13185 CYTHON_FALLTHROUGH;
13186 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13187 CYTHON_FALLTHROUGH;
13188 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13189 CYTHON_FALLTHROUGH;
13190 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13191 CYTHON_FALLTHROUGH;
13192 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13193 CYTHON_FALLTHROUGH;
13194 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13195 CYTHON_FALLTHROUGH;
13196 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13197 CYTHON_FALLTHROUGH;
13198 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13199 CYTHON_FALLTHROUGH;
13200 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13201 CYTHON_FALLTHROUGH;
13202 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13203 CYTHON_FALLTHROUGH;
13204 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13205 CYTHON_FALLTHROUGH;
13206 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13207 CYTHON_FALLTHROUGH;
13208 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13209 CYTHON_FALLTHROUGH;
13210 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13211 CYTHON_FALLTHROUGH;
13212 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13213 CYTHON_FALLTHROUGH;
13214 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13215 CYTHON_FALLTHROUGH;
13216 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13217 CYTHON_FALLTHROUGH;
13218 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13219 CYTHON_FALLTHROUGH;
13220 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13221 CYTHON_FALLTHROUGH;
13222 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13223 CYTHON_FALLTHROUGH;
13224 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13225 CYTHON_FALLTHROUGH;
13226 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13227 CYTHON_FALLTHROUGH;
13228 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13229 CYTHON_FALLTHROUGH;
13230 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13231 CYTHON_FALLTHROUGH;
13233 default:
goto __pyx_L5_argtuple_error;
13235 kw_args = PyDict_Size(__pyx_kwds);
13236 switch (pos_args) {
13238 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
13239 else goto __pyx_L5_argtuple_error;
13240 CYTHON_FALLTHROUGH;
13242 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
13244 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
13246 CYTHON_FALLTHROUGH;
13248 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
13250 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
13252 CYTHON_FALLTHROUGH;
13254 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
13256 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
13258 CYTHON_FALLTHROUGH;
13260 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
13262 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
13264 CYTHON_FALLTHROUGH;
13266 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
13268 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
13270 CYTHON_FALLTHROUGH;
13272 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
13274 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
13276 CYTHON_FALLTHROUGH;
13278 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
13280 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
13282 CYTHON_FALLTHROUGH;
13284 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
13286 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
13288 CYTHON_FALLTHROUGH;
13290 if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
13292 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
13294 CYTHON_FALLTHROUGH;
13296 if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
13298 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
13300 CYTHON_FALLTHROUGH;
13302 if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
13304 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
13306 CYTHON_FALLTHROUGH;
13308 if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
13310 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
13312 CYTHON_FALLTHROUGH;
13314 if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
13316 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
13318 CYTHON_FALLTHROUGH;
13320 if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
13322 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
13324 CYTHON_FALLTHROUGH;
13326 if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
13328 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
13330 CYTHON_FALLTHROUGH;
13332 if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
13334 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
13336 CYTHON_FALLTHROUGH;
13338 if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
13340 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
13342 CYTHON_FALLTHROUGH;
13344 if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
13346 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
13348 CYTHON_FALLTHROUGH;
13350 if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
13352 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
13354 CYTHON_FALLTHROUGH;
13356 if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
13358 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
13360 CYTHON_FALLTHROUGH;
13362 if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
13364 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
13366 CYTHON_FALLTHROUGH;
13368 if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
13370 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
13372 CYTHON_FALLTHROUGH;
13374 if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
13376 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
13378 CYTHON_FALLTHROUGH;
13380 if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
13382 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
13384 CYTHON_FALLTHROUGH;
13386 if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
13388 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
13391 if (unlikely(kw_args > 0)) {
13392 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
13394 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
13395 goto __pyx_L5_argtuple_error;
13397 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13398 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13399 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13400 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13401 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13402 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13403 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13404 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13405 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13406 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13407 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
13408 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
13409 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
13410 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
13411 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
13412 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
13413 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
13414 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
13415 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
13416 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
13417 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
13418 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
13419 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
13420 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
13421 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
13422 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
13424 __pyx_v_gravity = ((PyArrayObject *)values[0]);
13425 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
13426 __pyx_v_colind = ((PyArrayObject *)values[2]);
13427 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
13428 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
13429 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
13430 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
13431 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
13432 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
13433 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
13434 __pyx_v_q_u = ((PyArrayObject *)values[10]);
13435 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
13436 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
13437 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
13438 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
13439 __pyx_v_q_m = ((PyArrayObject *)values[15]);
13440 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
13441 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
13442 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
13443 __pyx_v_q_r = ((PyArrayObject *)values[19]);
13444 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
13445 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
13446 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
13447 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
13448 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
13449 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
13451 goto __pyx_L4_argument_unpacking_done;
13452 __pyx_L5_argtuple_error:;
13453 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
13455 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13456 __Pyx_RefNannyFinishContext();
13458 __pyx_L4_argument_unpacking_done:;
13459 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
13460 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
13461 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
13462 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
13463 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
13464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
13465 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
13466 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
13467 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
13468 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
13469 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
13470 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
13471 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
13472 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
13473 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
13474 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
13475 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
13476 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
13477 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
13478 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
13479 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
13480 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
13487 __Pyx_RefNannyFinishContext();
13491 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
13492 CYTHON_UNUSED
int __pyx_v_upwindFlag;
13493 CYTHON_UNUSED
int __pyx_v_picard;
13494 PyObject *__pyx_v_q = NULL;
13499 PyArrayObject *__pyx_v_a_up = 0;
13500 PyArrayObject *__pyx_v_f_up = 0;
13501 double __pyx_v_nAvgWeight;
13502 double __pyx_v_weight;
13503 double __pyx_v_volFactor;
13504 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
13505 double __pyx_v_volume;
13509 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13510 __Pyx_Buffer __pyx_pybuffer_a_up;
13511 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13512 __Pyx_Buffer __pyx_pybuffer_colind;
13513 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13514 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13515 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13516 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13517 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13518 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13519 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13520 __Pyx_Buffer __pyx_pybuffer_f_up;
13521 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13522 __Pyx_Buffer __pyx_pybuffer_gravity;
13523 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13524 __Pyx_Buffer __pyx_pybuffer_q_alin;
13525 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13526 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13527 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13528 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13529 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13530 __Pyx_Buffer __pyx_pybuffer_q_dm;
13531 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13532 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13533 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13534 __Pyx_Buffer __pyx_pybuffer_q_flin;
13535 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13536 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13537 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13538 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13539 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13540 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13541 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13542 __Pyx_Buffer __pyx_pybuffer_q_kr;
13543 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13544 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13545 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13546 __Pyx_Buffer __pyx_pybuffer_q_m;
13547 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13548 __Pyx_Buffer __pyx_pybuffer_q_mt;
13549 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13550 __Pyx_Buffer __pyx_pybuffer_q_r;
13551 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13552 __Pyx_Buffer __pyx_pybuffer_q_u;
13553 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13554 __Pyx_Buffer __pyx_pybuffer_rowptr;
13555 PyObject *__pyx_r = NULL;
13556 __Pyx_RefNannyDeclarations
13557 PyObject *__pyx_t_1 = NULL;
13558 PyObject *__pyx_t_2 = NULL;
13559 Py_ssize_t __pyx_t_3;
13560 PyObject *__pyx_t_4 = NULL;
13561 PyObject *__pyx_t_5 = NULL;
13563 Py_ssize_t __pyx_t_7;
13565 PyObject *__pyx_t_9 = NULL;
13566 PyArrayObject *__pyx_t_10 = NULL;
13567 PyArrayObject *__pyx_t_11 = NULL;
13571 Py_ssize_t __pyx_t_15;
13576 Py_ssize_t __pyx_t_20;
13577 Py_ssize_t __pyx_t_21;
13578 Py_ssize_t __pyx_t_22;
13585 Py_ssize_t __pyx_t_29;
13589 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_33;
13590 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_34;
13592 Py_ssize_t __pyx_t_36;
13593 Py_ssize_t __pyx_t_37;
13594 Py_ssize_t __pyx_t_38;
13595 Py_ssize_t __pyx_t_39;
13596 Py_ssize_t __pyx_t_40;
13597 Py_ssize_t __pyx_t_41;
13598 Py_ssize_t __pyx_t_42;
13599 Py_ssize_t __pyx_t_43;
13600 int __pyx_lineno = 0;
13601 const char *__pyx_filename = NULL;
13602 int __pyx_clineno = 0;
13603 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13604 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13605 __pyx_pybuffer_a_up.refcount = 0;
13606 __pyx_pybuffernd_a_up.data = NULL;
13607 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13608 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13609 __pyx_pybuffer_f_up.refcount = 0;
13610 __pyx_pybuffernd_f_up.data = NULL;
13611 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13612 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13613 __pyx_pybuffer_gravity.refcount = 0;
13614 __pyx_pybuffernd_gravity.data = NULL;
13615 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13616 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13617 __pyx_pybuffer_rowptr.refcount = 0;
13618 __pyx_pybuffernd_rowptr.data = NULL;
13619 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13620 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13621 __pyx_pybuffer_colind.refcount = 0;
13622 __pyx_pybuffernd_colind.data = NULL;
13623 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13624 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13625 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13626 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13627 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13628 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13629 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13630 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13631 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13632 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13633 __pyx_pybuffer_q_u.refcount = 0;
13634 __pyx_pybuffernd_q_u.data = NULL;
13635 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13636 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13637 __pyx_pybuffer_q_grad_u.refcount = 0;
13638 __pyx_pybuffernd_q_grad_u.data = NULL;
13639 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13640 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13641 __pyx_pybuffer_q_grad_w.refcount = 0;
13642 __pyx_pybuffernd_q_grad_w.data = NULL;
13643 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13644 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13645 __pyx_pybuffer_q_grad_v.refcount = 0;
13646 __pyx_pybuffernd_q_grad_v.data = NULL;
13647 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13648 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13649 __pyx_pybuffer_q_detJ.refcount = 0;
13650 __pyx_pybuffernd_q_detJ.data = NULL;
13651 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13652 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13653 __pyx_pybuffer_q_m.refcount = 0;
13654 __pyx_pybuffernd_q_m.data = NULL;
13655 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13656 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13657 __pyx_pybuffer_q_dm.refcount = 0;
13658 __pyx_pybuffernd_q_dm.data = NULL;
13659 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13660 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13661 __pyx_pybuffer_q_mt.refcount = 0;
13662 __pyx_pybuffernd_q_mt.data = NULL;
13663 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13664 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13665 __pyx_pybuffer_q_dmt.refcount = 0;
13666 __pyx_pybuffernd_q_dmt.data = NULL;
13667 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13668 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13669 __pyx_pybuffer_q_r.refcount = 0;
13670 __pyx_pybuffernd_q_r.data = NULL;
13671 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13672 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13673 __pyx_pybuffer_q_kr.refcount = 0;
13674 __pyx_pybuffernd_q_kr.data = NULL;
13675 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13676 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13677 __pyx_pybuffer_q_dkr.refcount = 0;
13678 __pyx_pybuffernd_q_dkr.data = NULL;
13679 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13680 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13681 __pyx_pybuffer_q_kr_up.refcount = 0;
13682 __pyx_pybuffernd_q_kr_up.data = NULL;
13683 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13684 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13685 __pyx_pybuffer_q_flin.refcount = 0;
13686 __pyx_pybuffernd_q_flin.data = NULL;
13687 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13688 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13689 __pyx_pybuffer_q_alin.refcount = 0;
13690 __pyx_pybuffernd_q_alin.data = NULL;
13691 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13692 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13693 __pyx_pybuffer_elementJacobian.refcount = 0;
13694 __pyx_pybuffernd_elementJacobian.data = NULL;
13695 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13697 __Pyx_BufFmt_StackElem __pyx_stack[1];
13698 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13700 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13702 __Pyx_BufFmt_StackElem __pyx_stack[1];
13703 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13705 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13707 __Pyx_BufFmt_StackElem __pyx_stack[1];
13708 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13710 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13712 __Pyx_BufFmt_StackElem __pyx_stack[1];
13713 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13715 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13717 __Pyx_BufFmt_StackElem __pyx_stack[1];
13718 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13720 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13722 __Pyx_BufFmt_StackElem __pyx_stack[1];
13723 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13725 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13727 __Pyx_BufFmt_StackElem __pyx_stack[1];
13728 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13730 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13732 __Pyx_BufFmt_StackElem __pyx_stack[1];
13733 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13735 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13737 __Pyx_BufFmt_StackElem __pyx_stack[1];
13738 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13740 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13742 __Pyx_BufFmt_StackElem __pyx_stack[1];
13743 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13745 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13747 __Pyx_BufFmt_StackElem __pyx_stack[1];
13748 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13750 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13752 __Pyx_BufFmt_StackElem __pyx_stack[1];
13753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13755 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13757 __Pyx_BufFmt_StackElem __pyx_stack[1];
13758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13760 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13762 __Pyx_BufFmt_StackElem __pyx_stack[1];
13763 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13765 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13767 __Pyx_BufFmt_StackElem __pyx_stack[1];
13768 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13770 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13772 __Pyx_BufFmt_StackElem __pyx_stack[1];
13773 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13775 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13777 __Pyx_BufFmt_StackElem __pyx_stack[1];
13778 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13780 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13782 __Pyx_BufFmt_StackElem __pyx_stack[1];
13783 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13785 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13787 __Pyx_BufFmt_StackElem __pyx_stack[1];
13788 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13790 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13792 __Pyx_BufFmt_StackElem __pyx_stack[1];
13793 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13795 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13797 __Pyx_BufFmt_StackElem __pyx_stack[1];
13798 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13800 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13809 __pyx_v_upwindFlag = 1;
13818 __pyx_v_picard = 1;
13827 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13828 __Pyx_GOTREF(__pyx_t_1);
13829 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13830 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13831 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13832 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13833 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13834 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13835 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13836 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13837 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13838 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13839 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13840 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13841 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13842 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13843 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13844 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13845 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13847 if (__pyx_t_3 >= 5)
break;
13848 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13849 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13851 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13852 __Pyx_GOTREF(__pyx_t_1);
13854 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13864 #ifndef CYTHON_WITHOUT_ASSERTIONS
13865 if (unlikely(!Py_OptimizeFlag)) {
13866 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13867 __Pyx_GOTREF(__pyx_t_1);
13868 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13869 __Pyx_GOTREF(__pyx_t_4);
13870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13871 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13872 __Pyx_GOTREF(__pyx_t_1);
13873 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13874 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13876 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13877 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13878 if (unlikely(!__pyx_t_6)) {
13879 PyErr_SetNone(PyExc_AssertionError);
13880 __PYX_ERR(0, 624, __pyx_L1_error)
13893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13902 #ifndef CYTHON_WITHOUT_ASSERTIONS
13903 if (unlikely(!Py_OptimizeFlag)) {
13904 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13905 PyErr_SetNone(PyExc_AssertionError);
13906 __PYX_ERR(0, 625, __pyx_L1_error)
13918 __pyx_t_7 = __pyx_v_nSpace;
13920 if (__pyx_t_7 < 0) {
13921 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13922 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
13923 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
13924 if (unlikely(__pyx_t_8 != -1)) {
13925 __Pyx_RaiseBufferIndexError(__pyx_t_8);
13926 __PYX_ERR(0, 626, __pyx_L1_error)
13928 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13937 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13938 __Pyx_GOTREF(__pyx_t_5);
13939 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
13940 __Pyx_GOTREF(__pyx_t_1);
13941 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13942 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13943 __Pyx_GOTREF(__pyx_t_5);
13946 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
13947 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
13948 if (likely(__pyx_t_4)) {
13949 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
13950 __Pyx_INCREF(__pyx_t_4);
13951 __Pyx_INCREF(
function);
13952 __Pyx_DECREF_SET(__pyx_t_1,
function);
13956 #if CYTHON_FAST_PYCALL
13957 if (PyFunction_Check(__pyx_t_1)) {
13958 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13959 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13960 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13961 __Pyx_GOTREF(__pyx_t_2);
13962 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13965 #if CYTHON_FAST_PYCCALL
13966 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
13967 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13968 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13969 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13970 __Pyx_GOTREF(__pyx_t_2);
13971 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13975 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
13976 __Pyx_GOTREF(__pyx_t_9);
13978 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
13980 __Pyx_GIVEREF(__pyx_t_5);
13981 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
13982 __Pyx_INCREF(__pyx_n_s_d);
13983 __Pyx_GIVEREF(__pyx_n_s_d);
13984 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
13986 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13987 __Pyx_GOTREF(__pyx_t_2);
13988 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13991 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
13992 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
13994 __Pyx_BufFmt_StackElem __pyx_stack[1];
13995 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13996 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
13997 __PYX_ERR(0, 630, __pyx_L1_error)
13998 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
14002 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
14012 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14013 __Pyx_GOTREF(__pyx_t_1);
14014 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
14015 __Pyx_GOTREF(__pyx_t_9);
14016 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14017 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
14018 __Pyx_GOTREF(__pyx_t_1);
14021 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14022 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
14023 if (likely(__pyx_t_5)) {
14024 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
14025 __Pyx_INCREF(__pyx_t_5);
14026 __Pyx_INCREF(
function);
14027 __Pyx_DECREF_SET(__pyx_t_9,
function);
14031 #if CYTHON_FAST_PYCALL
14032 if (PyFunction_Check(__pyx_t_9)) {
14033 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14034 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14035 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14036 __Pyx_GOTREF(__pyx_t_2);
14037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14040 #if CYTHON_FAST_PYCCALL
14041 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
14042 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
14043 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14044 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14045 __Pyx_GOTREF(__pyx_t_2);
14046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14050 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
14051 __Pyx_GOTREF(__pyx_t_4);
14053 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
14055 __Pyx_GIVEREF(__pyx_t_1);
14056 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
14057 __Pyx_INCREF(__pyx_n_s_d);
14058 __Pyx_GIVEREF(__pyx_n_s_d);
14059 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
14061 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14062 __Pyx_GOTREF(__pyx_t_2);
14063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14065 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14066 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
14067 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
14069 __Pyx_BufFmt_StackElem __pyx_stack[1];
14070 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
14071 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
14072 __PYX_ERR(0, 631, __pyx_L1_error)
14073 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
14077 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
14087 __pyx_t_12 = (__pyx_v_nSpace + 1.);
14088 if (unlikely(__pyx_t_12 == 0)) {
14089 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14090 __PYX_ERR(0, 633, __pyx_L1_error)
14092 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
14101 __pyx_v_weight = 1.0;
14102 __pyx_v_volFactor = 1.0;
14111 __pyx_v_thisElementIsUpwind = 1;
14120 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
14130 __pyx_v_volFactor = 0.5;
14148 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
14158 __pyx_v_volFactor = (1.0 / 6.0);
14176 __pyx_t_8 = __pyx_v_nElements_global;
14177 __pyx_t_13 = __pyx_t_8;
14178 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
14179 __pyx_v_eN = __pyx_t_14;
14188 __pyx_t_7 = __pyx_v_eN;
14191 if (__pyx_t_7 < 0) {
14192 __pyx_t_7 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
14193 if (unlikely(__pyx_t_7 < 0)) __pyx_t_16 = 0;
14194 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
14195 if (__pyx_t_15 < 0) {
14196 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
14197 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
14198 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
14199 if (unlikely(__pyx_t_16 != -1)) {
14200 __Pyx_RaiseBufferIndexError(__pyx_t_16);
14201 __PYX_ERR(0, 642, __pyx_L1_error)
14203 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
14212 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
14221 __pyx_t_16 = __pyx_v_nDOF_test_element;
14222 __pyx_t_17 = __pyx_t_16;
14223 for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
14224 __pyx_v_i = __pyx_t_18;
14233 __pyx_t_15 = __pyx_v_eN;
14234 __pyx_t_7 = __pyx_v_i;
14236 if (__pyx_t_15 < 0) {
14237 __pyx_t_15 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
14238 if (unlikely(__pyx_t_15 < 0)) __pyx_t_19 = 0;
14239 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_19 = 0;
14240 if (__pyx_t_7 < 0) {
14241 __pyx_t_7 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
14242 if (unlikely(__pyx_t_7 < 0)) __pyx_t_19 = 1;
14243 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_19 = 1;
14244 if (unlikely(__pyx_t_19 != -1)) {
14245 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14246 __PYX_ERR(0, 650, __pyx_L1_error)
14248 __pyx_t_20 = __pyx_v_eN;
14249 __pyx_t_21 = __pyx_v_i;
14250 __pyx_t_22 = __pyx_v_i;
14252 if (__pyx_t_20 < 0) {
14253 __pyx_t_20 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14254 if (unlikely(__pyx_t_20 < 0)) __pyx_t_19 = 0;
14255 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_19 = 0;
14256 if (__pyx_t_21 < 0) {
14257 __pyx_t_21 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14258 if (unlikely(__pyx_t_21 < 0)) __pyx_t_19 = 1;
14259 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_19 = 1;
14260 if (__pyx_t_22 < 0) {
14261 __pyx_t_22 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14262 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 2;
14263 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_19 = 2;
14264 if (unlikely(__pyx_t_19 != -1)) {
14265 __Pyx_RaiseBufferIndexError(__pyx_t_19);
14266 __PYX_ERR(0, 650, __pyx_L1_error)
14268 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
14277 __pyx_t_19 = __pyx_v_nElementBoundaries_element;
14278 __pyx_t_23 = __pyx_t_19;
14279 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_23; __pyx_t_24+=1) {
14280 __pyx_v_ebN = __pyx_t_24;
14289 __pyx_t_25 = __pyx_v_nnz;
14290 __pyx_t_26 = __pyx_t_25;
14291 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14292 __pyx_v_ii = __pyx_t_27;
14301 __pyx_t_7 = __pyx_v_eN;
14302 __pyx_t_15 = __pyx_v_ebN;
14303 __pyx_t_22 = __pyx_v_ii;
14305 if (__pyx_t_7 < 0) {
14306 __pyx_t_7 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
14307 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 0;
14308 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_28 = 0;
14309 if (__pyx_t_15 < 0) {
14310 __pyx_t_15 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
14311 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 1;
14312 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_28 = 1;
14313 if (__pyx_t_22 < 0) {
14314 __pyx_t_22 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
14315 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14316 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_28 = 2;
14317 if (unlikely(__pyx_t_28 != -1)) {
14318 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14319 __PYX_ERR(0, 656, __pyx_L1_error)
14321 __pyx_t_21 = __pyx_v_eN;
14322 __pyx_t_20 = __pyx_v_ebN;
14324 if (__pyx_t_21 < 0) {
14325 __pyx_t_21 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14326 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 0;
14327 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14328 if (__pyx_t_20 < 0) {
14329 __pyx_t_20 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14330 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 1;
14331 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14332 if (unlikely(__pyx_t_28 != -1)) {
14333 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14334 __PYX_ERR(0, 656, __pyx_L1_error)
14336 __pyx_t_29 = __pyx_v_ii;
14338 if (__pyx_t_29 < 0) {
14339 __pyx_t_29 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14340 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14341 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_28 = 0;
14342 if (unlikely(__pyx_t_28 != -1)) {
14343 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14344 __PYX_ERR(0, 656, __pyx_L1_error)
14346 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14356 __pyx_t_25 = __pyx_v_nSpace;
14357 __pyx_t_26 = __pyx_t_25;
14358 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14359 __pyx_v_I = __pyx_t_27;
14368 __pyx_t_20 = __pyx_v_eN;
14369 __pyx_t_21 = __pyx_v_ebN;
14370 __pyx_t_22 = __pyx_v_I;
14372 if (__pyx_t_20 < 0) {
14373 __pyx_t_20 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
14374 if (unlikely(__pyx_t_20 < 0)) __pyx_t_28 = 0;
14375 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_28 = 0;
14376 if (__pyx_t_21 < 0) {
14377 __pyx_t_21 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
14378 if (unlikely(__pyx_t_21 < 0)) __pyx_t_28 = 1;
14379 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_28 = 1;
14380 if (__pyx_t_22 < 0) {
14381 __pyx_t_22 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
14382 if (unlikely(__pyx_t_22 < 0)) __pyx_t_28 = 2;
14383 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_28 = 2;
14384 if (unlikely(__pyx_t_28 != -1)) {
14385 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14386 __PYX_ERR(0, 658, __pyx_L1_error)
14388 __pyx_t_15 = __pyx_v_eN;
14389 __pyx_t_7 = __pyx_v_ebN;
14391 if (__pyx_t_15 < 0) {
14392 __pyx_t_15 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
14393 if (unlikely(__pyx_t_15 < 0)) __pyx_t_28 = 0;
14394 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_28 = 0;
14395 if (__pyx_t_7 < 0) {
14396 __pyx_t_7 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
14397 if (unlikely(__pyx_t_7 < 0)) __pyx_t_28 = 1;
14398 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_28 = 1;
14399 if (unlikely(__pyx_t_28 != -1)) {
14400 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14401 __PYX_ERR(0, 658, __pyx_L1_error)
14403 __pyx_t_29 = __pyx_v_I;
14405 if (__pyx_t_29 < 0) {
14406 __pyx_t_29 += __pyx_pybuffernd_f_up.diminfo[0].shape;
14407 if (unlikely(__pyx_t_29 < 0)) __pyx_t_28 = 0;
14408 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_28 = 0;
14409 if (unlikely(__pyx_t_28 != -1)) {
14410 __Pyx_RaiseBufferIndexError(__pyx_t_28);
14411 __PYX_ERR(0, 658, __pyx_L1_error)
14413 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
14423 __pyx_t_25 = __pyx_v_nDOF_trial_element;
14424 __pyx_t_26 = __pyx_t_25;
14425 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
14426 __pyx_v_j = __pyx_t_27;
14435 __pyx_t_28 = __pyx_v_nSpace;
14436 __pyx_t_30 = __pyx_t_28;
14437 for (__pyx_t_31 = 0; __pyx_t_31 < __pyx_t_30; __pyx_t_31+=1) {
14438 __pyx_v_I = __pyx_t_31;
14447 __pyx_t_7 = (__pyx_v_I + 1);
14449 if (__pyx_t_7 < 0) {
14450 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14451 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14452 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14453 if (unlikely(__pyx_t_32 != -1)) {
14454 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14455 __PYX_ERR(0, 664, __pyx_L1_error)
14457 __pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
14458 __pyx_t_7 = __pyx_v_I;
14460 if (__pyx_t_7 < 0) {
14461 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
14462 if (unlikely(__pyx_t_7 < 0)) __pyx_t_32 = 0;
14463 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_32 = 0;
14464 if (unlikely(__pyx_t_32 != -1)) {
14465 __Pyx_RaiseBufferIndexError(__pyx_t_32);
14466 __PYX_ERR(0, 664, __pyx_L1_error)
14468 __pyx_t_34 = __pyx_t_33;
14469 for (__pyx_t_32 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_32 < __pyx_t_34; __pyx_t_32+=1) {
14470 __pyx_v_ii = __pyx_t_32;
14479 __pyx_t_15 = __pyx_v_ii;
14481 if (__pyx_t_15 < 0) {
14482 __pyx_t_15 += __pyx_pybuffernd_a_up.diminfo[0].shape;
14483 if (unlikely(__pyx_t_15 < 0)) __pyx_t_35 = 0;
14484 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_35 = 0;
14485 if (unlikely(__pyx_t_35 != -1)) {
14486 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14487 __PYX_ERR(0, 665, __pyx_L1_error)
14489 __pyx_t_22 = __pyx_v_ii;
14491 if (__pyx_t_22 < 0) {
14492 __pyx_t_22 += __pyx_pybuffernd_colind.diminfo[0].shape;
14493 if (unlikely(__pyx_t_22 < 0)) __pyx_t_35 = 0;
14494 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_35 = 0;
14495 if (unlikely(__pyx_t_35 != -1)) {
14496 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14497 __PYX_ERR(0, 665, __pyx_L1_error)
14499 __pyx_t_21 = __pyx_v_eN;
14500 __pyx_t_20 = __pyx_v_ebN;
14501 __pyx_t_29 = __pyx_v_j;
14502 __pyx_t_36 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_colind.diminfo[0].strides));
14504 if (__pyx_t_21 < 0) {
14505 __pyx_t_21 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14506 if (unlikely(__pyx_t_21 < 0)) __pyx_t_35 = 0;
14507 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_35 = 0;
14508 if (__pyx_t_20 < 0) {
14509 __pyx_t_20 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14510 if (unlikely(__pyx_t_20 < 0)) __pyx_t_35 = 1;
14511 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_35 = 1;
14512 if (__pyx_t_29 < 0) {
14513 __pyx_t_29 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14514 if (unlikely(__pyx_t_29 < 0)) __pyx_t_35 = 2;
14515 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_35 = 2;
14516 if (__pyx_t_36 < 0) {
14517 __pyx_t_36 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14518 if (unlikely(__pyx_t_36 < 0)) __pyx_t_35 = 3;
14519 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_35 = 3;
14520 if (unlikely(__pyx_t_35 != -1)) {
14521 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14522 __PYX_ERR(0, 665, __pyx_L1_error)
14524 __pyx_t_37 = __pyx_v_eN;
14525 __pyx_t_38 = __pyx_v_ebN;
14526 __pyx_t_39 = __pyx_v_i;
14527 __pyx_t_40 = __pyx_v_I;
14529 if (__pyx_t_37 < 0) {
14530 __pyx_t_37 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14531 if (unlikely(__pyx_t_37 < 0)) __pyx_t_35 = 0;
14532 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_35 = 0;
14533 if (__pyx_t_38 < 0) {
14534 __pyx_t_38 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14535 if (unlikely(__pyx_t_38 < 0)) __pyx_t_35 = 1;
14536 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_35 = 1;
14537 if (__pyx_t_39 < 0) {
14538 __pyx_t_39 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14539 if (unlikely(__pyx_t_39 < 0)) __pyx_t_35 = 2;
14540 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_35 = 2;
14541 if (__pyx_t_40 < 0) {
14542 __pyx_t_40 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14543 if (unlikely(__pyx_t_40 < 0)) __pyx_t_35 = 3;
14544 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_35 = 3;
14545 if (unlikely(__pyx_t_35 != -1)) {
14546 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14547 __PYX_ERR(0, 665, __pyx_L1_error)
14549 __pyx_t_41 = __pyx_v_eN;
14550 __pyx_t_42 = __pyx_v_i;
14551 __pyx_t_43 = __pyx_v_j;
14553 if (__pyx_t_41 < 0) {
14554 __pyx_t_41 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14555 if (unlikely(__pyx_t_41 < 0)) __pyx_t_35 = 0;
14556 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_35 = 0;
14557 if (__pyx_t_42 < 0) {
14558 __pyx_t_42 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14559 if (unlikely(__pyx_t_42 < 0)) __pyx_t_35 = 1;
14560 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_35 = 1;
14561 if (__pyx_t_43 < 0) {
14562 __pyx_t_43 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14563 if (unlikely(__pyx_t_43 < 0)) __pyx_t_35 = 2;
14564 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_35 = 2;
14565 if (unlikely(__pyx_t_35 != -1)) {
14566 __Pyx_RaiseBufferIndexError(__pyx_t_35);
14567 __PYX_ERR(0, 665, __pyx_L1_error)
14569 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_36, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_40, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14586 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14589 __Pyx_XDECREF(__pyx_t_1);
14590 __Pyx_XDECREF(__pyx_t_2);
14591 __Pyx_XDECREF(__pyx_t_4);
14592 __Pyx_XDECREF(__pyx_t_5);
14593 __Pyx_XDECREF(__pyx_t_9);
14594 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14595 __Pyx_PyThreadState_declare
14596 __Pyx_PyThreadState_assign
14597 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14598 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14599 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14600 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14601 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14602 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14603 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14604 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14605 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14606 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14607 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14608 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14609 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14610 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14612 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14613 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14614 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14615 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14616 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14617 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14618 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14619 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14620 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14621 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14622 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14635 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14643 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14644 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14645 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14646 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14647 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14648 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14650 __Pyx_XDECREF(__pyx_v_q);
14651 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14652 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14653 __Pyx_XGIVEREF(__pyx_r);
14654 __Pyx_RefNannyFinishContext();
14667 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14668 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14669 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14670 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14671 PyArrayObject *__pyx_v_mt = 0;
14672 PyArrayObject *__pyx_v_w = 0;
14673 PyArrayObject *__pyx_v_dV = 0;
14674 PyArrayObject *__pyx_v_weak_residual = 0;
14675 int __pyx_lineno = 0;
14676 const char *__pyx_filename = NULL;
14677 int __pyx_clineno = 0;
14678 PyObject *__pyx_r = 0;
14679 __Pyx_RefNannyDeclarations
14680 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14682 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14683 PyObject* values[4] = {0,0,0,0};
14684 if (unlikely(__pyx_kwds)) {
14685 Py_ssize_t kw_args;
14686 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14687 switch (pos_args) {
14688 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14689 CYTHON_FALLTHROUGH;
14690 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14691 CYTHON_FALLTHROUGH;
14692 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14693 CYTHON_FALLTHROUGH;
14694 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14695 CYTHON_FALLTHROUGH;
14697 default:
goto __pyx_L5_argtuple_error;
14699 kw_args = PyDict_Size(__pyx_kwds);
14700 switch (pos_args) {
14702 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14703 else goto __pyx_L5_argtuple_error;
14704 CYTHON_FALLTHROUGH;
14706 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14708 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14710 CYTHON_FALLTHROUGH;
14712 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14714 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14716 CYTHON_FALLTHROUGH;
14718 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14720 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14723 if (unlikely(kw_args > 0)) {
14724 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14726 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14727 goto __pyx_L5_argtuple_error;
14729 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14730 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14731 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14732 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14734 __pyx_v_mt = ((PyArrayObject *)values[0]);
14735 __pyx_v_w = ((PyArrayObject *)values[1]);
14736 __pyx_v_dV = ((PyArrayObject *)values[2]);
14737 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14739 goto __pyx_L4_argument_unpacking_done;
14740 __pyx_L5_argtuple_error:;
14741 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14743 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14744 __Pyx_RefNannyFinishContext();
14746 __pyx_L4_argument_unpacking_done:;
14747 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14748 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14749 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14750 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14751 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14758 __Pyx_RefNannyFinishContext();
14762 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14766 PyObject *__pyx_v_mt_avg = 0;
14767 PyObject *__pyx_v_vol = 0;
14768 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14769 __Pyx_Buffer __pyx_pybuffer_dV;
14770 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14771 __Pyx_Buffer __pyx_pybuffer_mt;
14772 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14773 __Pyx_Buffer __pyx_pybuffer_w;
14774 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14775 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14776 PyObject *__pyx_r = NULL;
14777 __Pyx_RefNannyDeclarations
14778 npy_intp __pyx_t_1;
14779 npy_intp __pyx_t_2;
14781 npy_intp __pyx_t_4;
14782 npy_intp __pyx_t_5;
14784 Py_ssize_t __pyx_t_7;
14785 Py_ssize_t __pyx_t_8;
14787 Py_ssize_t __pyx_t_10;
14788 Py_ssize_t __pyx_t_11;
14789 PyObject *__pyx_t_12 = NULL;
14790 PyObject *__pyx_t_13 = NULL;
14791 PyObject *__pyx_t_14 = NULL;
14793 int __pyx_lineno = 0;
14794 const char *__pyx_filename = NULL;
14795 int __pyx_clineno = 0;
14796 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14797 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14798 __pyx_pybuffer_mt.refcount = 0;
14799 __pyx_pybuffernd_mt.data = NULL;
14800 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14801 __pyx_pybuffer_w.pybuffer.buf = NULL;
14802 __pyx_pybuffer_w.refcount = 0;
14803 __pyx_pybuffernd_w.data = NULL;
14804 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14805 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14806 __pyx_pybuffer_dV.refcount = 0;
14807 __pyx_pybuffernd_dV.data = NULL;
14808 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14809 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14810 __pyx_pybuffer_weak_residual.refcount = 0;
14811 __pyx_pybuffernd_weak_residual.data = NULL;
14812 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14814 __Pyx_BufFmt_StackElem __pyx_stack[1];
14815 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14817 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14819 __Pyx_BufFmt_StackElem __pyx_stack[1];
14820 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14822 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14824 __Pyx_BufFmt_StackElem __pyx_stack[1];
14825 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14827 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14829 __Pyx_BufFmt_StackElem __pyx_stack[1];
14830 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14832 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14841 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14842 __pyx_t_2 = __pyx_t_1;
14843 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
14844 __pyx_v_eN = __pyx_t_3;
14853 __Pyx_INCREF(__pyx_float_0_0);
14854 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14863 __Pyx_INCREF(__pyx_float_0_0);
14864 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14873 __pyx_t_4 = (__pyx_v_mt->dimensions[1]);
14874 __pyx_t_5 = __pyx_t_4;
14875 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14876 __pyx_v_k = __pyx_t_6;
14885 __pyx_t_7 = __pyx_v_eN;
14886 __pyx_t_8 = __pyx_v_k;
14888 if (__pyx_t_7 < 0) {
14889 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
14890 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
14891 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14892 if (__pyx_t_8 < 0) {
14893 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
14894 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
14895 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14896 if (unlikely(__pyx_t_9 != -1)) {
14897 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14898 __PYX_ERR(0, 686, __pyx_L1_error)
14900 __pyx_t_10 = __pyx_v_eN;
14901 __pyx_t_11 = __pyx_v_k;
14903 if (__pyx_t_10 < 0) {
14904 __pyx_t_10 += __pyx_pybuffernd_mt.diminfo[0].shape;
14905 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14906 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_9 = 0;
14907 if (__pyx_t_11 < 0) {
14908 __pyx_t_11 += __pyx_pybuffernd_mt.diminfo[1].shape;
14909 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14910 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_9 = 1;
14911 if (unlikely(__pyx_t_9 != -1)) {
14912 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14913 __PYX_ERR(0, 686, __pyx_L1_error)
14915 __pyx_t_12 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 686, __pyx_L1_error)
14916 __Pyx_GOTREF(__pyx_t_12);
14917 __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 686, __pyx_L1_error)
14918 __Pyx_GOTREF(__pyx_t_13);
14919 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14920 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_13);
14930 __pyx_t_11 = __pyx_v_eN;
14931 __pyx_t_10 = __pyx_v_k;
14933 if (__pyx_t_11 < 0) {
14934 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
14935 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
14936 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
14937 if (__pyx_t_10 < 0) {
14938 __pyx_t_10 += __pyx_pybuffernd_dV.diminfo[1].shape;
14939 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
14940 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
14941 if (unlikely(__pyx_t_9 != -1)) {
14942 __Pyx_RaiseBufferIndexError(__pyx_t_9);
14943 __PYX_ERR(0, 687, __pyx_L1_error)
14945 __pyx_t_13 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 687, __pyx_L1_error)
14946 __Pyx_GOTREF(__pyx_t_13);
14947 __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_13);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 687, __pyx_L1_error)
14948 __Pyx_GOTREF(__pyx_t_12);
14949 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
14950 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_12);
14961 __pyx_t_12 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 688, __pyx_L1_error)
14962 __Pyx_GOTREF(__pyx_t_12);
14963 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_12);
14973 __pyx_t_4 = (__pyx_v_weak_residual->dimensions[1]);
14974 __pyx_t_5 = __pyx_t_4;
14975 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14976 __pyx_v_i = __pyx_t_6;
14985 __pyx_t_10 = __pyx_v_eN;
14986 __pyx_t_11 = __pyx_v_k;
14987 __pyx_t_8 = __pyx_v_i;
14989 if (__pyx_t_10 < 0) {
14990 __pyx_t_10 += __pyx_pybuffernd_w.diminfo[0].shape;
14991 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
14992 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_9 = 0;
14993 if (__pyx_t_11 < 0) {
14994 __pyx_t_11 += __pyx_pybuffernd_w.diminfo[1].shape;
14995 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
14996 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_9 = 1;
14997 if (__pyx_t_8 < 0) {
14998 __pyx_t_8 += __pyx_pybuffernd_w.diminfo[2].shape;
14999 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
15000 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_9 = 2;
15001 if (unlikely(__pyx_t_9 != -1)) {
15002 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15003 __PYX_ERR(0, 691, __pyx_L1_error)
15005 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15006 __Pyx_GOTREF(__pyx_t_12);
15007 __pyx_t_13 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_12);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 691, __pyx_L1_error)
15008 __Pyx_GOTREF(__pyx_t_13);
15009 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15010 __pyx_t_8 = __pyx_v_eN;
15011 __pyx_t_11 = __pyx_v_k;
15013 if (__pyx_t_8 < 0) {
15014 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15015 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
15016 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15017 if (__pyx_t_11 < 0) {
15018 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[1].shape;
15019 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
15020 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15021 if (unlikely(__pyx_t_9 != -1)) {
15022 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15023 __PYX_ERR(0, 691, __pyx_L1_error)
15025 __pyx_t_12 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 691, __pyx_L1_error)
15026 __Pyx_GOTREF(__pyx_t_12);
15027 __pyx_t_14 = PyNumber_Multiply(__pyx_t_13, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 691, __pyx_L1_error)
15028 __Pyx_GOTREF(__pyx_t_14);
15029 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15030 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15031 __pyx_t_15 = __Pyx_PyObject_AsDouble(__pyx_t_14);
if (unlikely(__pyx_t_15 == ((
double)((
double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
15032 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
15033 __pyx_t_11 = __pyx_v_eN;
15034 __pyx_t_8 = __pyx_v_i;
15036 if (__pyx_t_11 < 0) {
15037 __pyx_t_11 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
15038 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
15039 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_9 = 0;
15040 if (__pyx_t_8 < 0) {
15041 __pyx_t_8 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
15042 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15043 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_9 = 1;
15044 if (unlikely(__pyx_t_9 != -1)) {
15045 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15046 __PYX_ERR(0, 691, __pyx_L1_error)
15048 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_15;
15061 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15064 __Pyx_XDECREF(__pyx_t_12);
15065 __Pyx_XDECREF(__pyx_t_13);
15066 __Pyx_XDECREF(__pyx_t_14);
15067 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15068 __Pyx_PyThreadState_declare
15069 __Pyx_PyThreadState_assign
15070 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15071 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15072 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15073 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15074 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15075 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15076 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15080 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15081 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
15082 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15083 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
15085 __Pyx_XDECREF(__pyx_v_mt_avg);
15086 __Pyx_XDECREF(__pyx_v_vol);
15087 __Pyx_XGIVEREF(__pyx_r);
15088 __Pyx_RefNannyFinishContext();
15101 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15102 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
15103 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
15104 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15105 PyArrayObject *__pyx_v_dmt = 0;
15106 PyArrayObject *__pyx_v_w = 0;
15107 PyArrayObject *__pyx_v_v = 0;
15108 PyArrayObject *__pyx_v_dV = 0;
15109 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
15110 int __pyx_lineno = 0;
15111 const char *__pyx_filename = NULL;
15112 int __pyx_clineno = 0;
15113 PyObject *__pyx_r = 0;
15114 __Pyx_RefNannyDeclarations
15115 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
15117 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
15118 PyObject* values[5] = {0,0,0,0,0};
15119 if (unlikely(__pyx_kwds)) {
15120 Py_ssize_t kw_args;
15121 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15122 switch (pos_args) {
15123 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15124 CYTHON_FALLTHROUGH;
15125 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15126 CYTHON_FALLTHROUGH;
15127 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15128 CYTHON_FALLTHROUGH;
15129 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15130 CYTHON_FALLTHROUGH;
15131 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15132 CYTHON_FALLTHROUGH;
15134 default:
goto __pyx_L5_argtuple_error;
15136 kw_args = PyDict_Size(__pyx_kwds);
15137 switch (pos_args) {
15139 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
15140 else goto __pyx_L5_argtuple_error;
15141 CYTHON_FALLTHROUGH;
15143 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
15145 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
15147 CYTHON_FALLTHROUGH;
15149 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15151 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
15153 CYTHON_FALLTHROUGH;
15155 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15157 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
15159 CYTHON_FALLTHROUGH;
15161 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
15163 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
15166 if (unlikely(kw_args > 0)) {
15167 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
15169 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15170 goto __pyx_L5_argtuple_error;
15172 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15173 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15174 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15175 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15176 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15178 __pyx_v_dmt = ((PyArrayObject *)values[0]);
15179 __pyx_v_w = ((PyArrayObject *)values[1]);
15180 __pyx_v_v = ((PyArrayObject *)values[2]);
15181 __pyx_v_dV = ((PyArrayObject *)values[3]);
15182 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
15184 goto __pyx_L4_argument_unpacking_done;
15185 __pyx_L5_argtuple_error:;
15186 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
15188 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15189 __Pyx_RefNannyFinishContext();
15191 __pyx_L4_argument_unpacking_done:;
15192 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
15193 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
15194 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
15195 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
15196 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
15197 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
15204 __Pyx_RefNannyFinishContext();
15208 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
15213 double __pyx_v_dmtj_avg;
15214 double __pyx_v_vol;
15215 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15216 __Pyx_Buffer __pyx_pybuffer_dV;
15217 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
15218 __Pyx_Buffer __pyx_pybuffer_dmt;
15219 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
15220 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
15221 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15222 __Pyx_Buffer __pyx_pybuffer_v;
15223 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
15224 __Pyx_Buffer __pyx_pybuffer_w;
15225 PyObject *__pyx_r = NULL;
15226 __Pyx_RefNannyDeclarations
15227 npy_intp __pyx_t_1;
15228 npy_intp __pyx_t_2;
15230 npy_intp __pyx_t_4;
15231 npy_intp __pyx_t_5;
15233 Py_ssize_t __pyx_t_7;
15234 Py_ssize_t __pyx_t_8;
15236 npy_intp __pyx_t_10;
15237 npy_intp __pyx_t_11;
15238 npy_intp __pyx_t_12;
15239 npy_intp __pyx_t_13;
15242 Py_ssize_t __pyx_t_16;
15243 Py_ssize_t __pyx_t_17;
15244 Py_ssize_t __pyx_t_18;
15245 Py_ssize_t __pyx_t_19;
15246 Py_ssize_t __pyx_t_20;
15247 Py_ssize_t __pyx_t_21;
15248 int __pyx_lineno = 0;
15249 const char *__pyx_filename = NULL;
15250 int __pyx_clineno = 0;
15251 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
15252 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
15253 __pyx_pybuffer_dmt.refcount = 0;
15254 __pyx_pybuffernd_dmt.data = NULL;
15255 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
15256 __pyx_pybuffer_w.pybuffer.buf = NULL;
15257 __pyx_pybuffer_w.refcount = 0;
15258 __pyx_pybuffernd_w.data = NULL;
15259 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
15260 __pyx_pybuffer_v.pybuffer.buf = NULL;
15261 __pyx_pybuffer_v.refcount = 0;
15262 __pyx_pybuffernd_v.data = NULL;
15263 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15264 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15265 __pyx_pybuffer_dV.refcount = 0;
15266 __pyx_pybuffernd_dV.data = NULL;
15267 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15268 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
15269 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
15270 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
15271 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
15273 __Pyx_BufFmt_StackElem __pyx_stack[1];
15274 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15276 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
15278 __Pyx_BufFmt_StackElem __pyx_stack[1];
15279 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15281 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
15283 __Pyx_BufFmt_StackElem __pyx_stack[1];
15284 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15286 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15288 __Pyx_BufFmt_StackElem __pyx_stack[1];
15289 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15291 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15293 __Pyx_BufFmt_StackElem __pyx_stack[1];
15294 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
15296 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
15305 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
15306 __pyx_t_2 = __pyx_t_1;
15307 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15308 __pyx_v_eN = __pyx_t_3;
15326 __pyx_t_4 = (__pyx_v_dmt->dimensions[1]);
15327 __pyx_t_5 = __pyx_t_4;
15328 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15329 __pyx_v_k = __pyx_t_6;
15338 __pyx_t_7 = __pyx_v_eN;
15339 __pyx_t_8 = __pyx_v_k;
15341 if (__pyx_t_7 < 0) {
15342 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
15343 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
15344 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
15345 if (__pyx_t_8 < 0) {
15346 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
15347 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
15348 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
15349 if (unlikely(__pyx_t_9 != -1)) {
15350 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15351 __PYX_ERR(0, 705, __pyx_L1_error)
15353 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
15363 __pyx_t_4 = (__pyx_v_w->dimensions[2]);
15364 __pyx_t_5 = __pyx_t_4;
15365 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15366 __pyx_v_i = __pyx_t_6;
15375 __pyx_t_10 = (__pyx_v_v->dimensions[2]);
15376 __pyx_t_11 = __pyx_t_10;
15377 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_11; __pyx_t_9+=1) {
15378 __pyx_v_j = __pyx_t_9;
15387 __pyx_v_dmtj_avg = 0.0;
15396 __pyx_t_12 = (__pyx_v_dmt->dimensions[1]);
15397 __pyx_t_13 = __pyx_t_12;
15398 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
15399 __pyx_v_k = __pyx_t_14;
15408 __pyx_t_8 = __pyx_v_eN;
15409 __pyx_t_7 = __pyx_v_k;
15411 if (__pyx_t_8 < 0) {
15412 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15413 if (unlikely(__pyx_t_8 < 0)) __pyx_t_15 = 0;
15414 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_15 = 0;
15415 if (__pyx_t_7 < 0) {
15416 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
15417 if (unlikely(__pyx_t_7 < 0)) __pyx_t_15 = 1;
15418 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_15 = 1;
15419 if (unlikely(__pyx_t_15 != -1)) {
15420 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15421 __PYX_ERR(0, 710, __pyx_L1_error)
15423 __pyx_t_16 = __pyx_v_eN;
15424 __pyx_t_17 = __pyx_v_k;
15426 if (__pyx_t_16 < 0) {
15427 __pyx_t_16 += __pyx_pybuffernd_dmt.diminfo[0].shape;
15428 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
15429 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_15 = 0;
15430 if (__pyx_t_17 < 0) {
15431 __pyx_t_17 += __pyx_pybuffernd_dmt.diminfo[1].shape;
15432 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
15433 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_15 = 1;
15434 if (unlikely(__pyx_t_15 != -1)) {
15435 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15436 __PYX_ERR(0, 710, __pyx_L1_error)
15438 __pyx_t_18 = __pyx_v_eN;
15439 __pyx_t_19 = __pyx_v_k;
15440 __pyx_t_20 = __pyx_v_j;
15442 if (__pyx_t_18 < 0) {
15443 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[0].shape;
15444 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 0;
15445 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
15446 if (__pyx_t_19 < 0) {
15447 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[1].shape;
15448 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 1;
15449 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
15450 if (__pyx_t_20 < 0) {
15451 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[2].shape;
15452 if (unlikely(__pyx_t_20 < 0)) __pyx_t_15 = 2;
15453 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
15454 if (unlikely(__pyx_t_15 != -1)) {
15455 __Pyx_RaiseBufferIndexError(__pyx_t_15);
15456 __PYX_ERR(0, 710, __pyx_L1_error)
15458 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[2].strides))));
15468 if (unlikely(__pyx_v_vol == 0)) {
15469 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15470 __PYX_ERR(0, 711, __pyx_L1_error)
15472 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
15481 __pyx_t_20 = __pyx_v_eN;
15482 __pyx_t_19 = __pyx_v_k;
15483 __pyx_t_18 = __pyx_v_i;
15485 if (__pyx_t_20 < 0) {
15486 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[0].shape;
15487 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 0;
15488 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_14 = 0;
15489 if (__pyx_t_19 < 0) {
15490 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[1].shape;
15491 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 1;
15492 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_14 = 1;
15493 if (__pyx_t_18 < 0) {
15494 __pyx_t_18 += __pyx_pybuffernd_w.diminfo[2].shape;
15495 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 2;
15496 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_14 = 2;
15497 if (unlikely(__pyx_t_14 != -1)) {
15498 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15499 __PYX_ERR(0, 712, __pyx_L1_error)
15501 __pyx_t_17 = __pyx_v_eN;
15502 __pyx_t_16 = __pyx_v_k;
15504 if (__pyx_t_17 < 0) {
15505 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
15506 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
15507 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_14 = 0;
15508 if (__pyx_t_16 < 0) {
15509 __pyx_t_16 += __pyx_pybuffernd_dV.diminfo[1].shape;
15510 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
15511 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_14 = 1;
15512 if (unlikely(__pyx_t_14 != -1)) {
15513 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15514 __PYX_ERR(0, 712, __pyx_L1_error)
15516 __pyx_t_7 = __pyx_v_eN;
15517 __pyx_t_8 = __pyx_v_i;
15518 __pyx_t_21 = __pyx_v_j;
15520 if (__pyx_t_7 < 0) {
15521 __pyx_t_7 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
15522 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
15523 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_14 = 0;
15524 if (__pyx_t_8 < 0) {
15525 __pyx_t_8 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15526 if (unlikely(__pyx_t_8 < 0)) __pyx_t_14 = 1;
15527 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_14 = 1;
15528 if (__pyx_t_21 < 0) {
15529 __pyx_t_21 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15530 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
15531 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_14 = 2;
15532 if (unlikely(__pyx_t_14 != -1)) {
15533 __Pyx_RaiseBufferIndexError(__pyx_t_14);
15534 __PYX_ERR(0, 712, __pyx_L1_error)
15536 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_dV.diminfo[1].strides)));
15550 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15553 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15554 __Pyx_PyThreadState_declare
15555 __Pyx_PyThreadState_assign
15556 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15557 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15558 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15559 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15560 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15561 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15562 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15563 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15567 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15568 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15569 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15570 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15571 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15573 __Pyx_XGIVEREF(__pyx_r);
15574 __Pyx_RefNannyFinishContext();
15587 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15588 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15589 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15590 PyArrayObject *__pyx_v_v = 0;
15591 PyArrayObject *__pyx_v_n = 0;
15592 PyArrayObject *__pyx_v_dS = 0;
15593 PyArrayObject *__pyx_v_flux = 0;
15594 int __pyx_lineno = 0;
15595 const char *__pyx_filename = NULL;
15596 int __pyx_clineno = 0;
15597 PyObject *__pyx_r = 0;
15598 __Pyx_RefNannyDeclarations
15599 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15601 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15602 PyObject* values[4] = {0,0,0,0};
15603 if (unlikely(__pyx_kwds)) {
15604 Py_ssize_t kw_args;
15605 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15606 switch (pos_args) {
15607 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15608 CYTHON_FALLTHROUGH;
15609 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15610 CYTHON_FALLTHROUGH;
15611 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15612 CYTHON_FALLTHROUGH;
15613 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15614 CYTHON_FALLTHROUGH;
15616 default:
goto __pyx_L5_argtuple_error;
15618 kw_args = PyDict_Size(__pyx_kwds);
15619 switch (pos_args) {
15621 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15622 else goto __pyx_L5_argtuple_error;
15623 CYTHON_FALLTHROUGH;
15625 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15627 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15629 CYTHON_FALLTHROUGH;
15631 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15633 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15635 CYTHON_FALLTHROUGH;
15637 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15639 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15642 if (unlikely(kw_args > 0)) {
15643 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15645 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15646 goto __pyx_L5_argtuple_error;
15648 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15649 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15650 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15651 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15653 __pyx_v_v = ((PyArrayObject *)values[0]);
15654 __pyx_v_n = ((PyArrayObject *)values[1]);
15655 __pyx_v_dS = ((PyArrayObject *)values[2]);
15656 __pyx_v_flux = ((PyArrayObject *)values[3]);
15658 goto __pyx_L4_argument_unpacking_done;
15659 __pyx_L5_argtuple_error:;
15660 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15662 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15663 __Pyx_RefNannyFinishContext();
15665 __pyx_L4_argument_unpacking_done:;
15666 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15667 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15668 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15669 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15670 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15677 __Pyx_RefNannyFinishContext();
15681 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15685 double __pyx_v_integral;
15686 npy_intp __pyx_v_I;
15687 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15688 __Pyx_Buffer __pyx_pybuffer_dS;
15689 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15690 __Pyx_Buffer __pyx_pybuffer_flux;
15691 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15692 __Pyx_Buffer __pyx_pybuffer_n;
15693 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15694 __Pyx_Buffer __pyx_pybuffer_v;
15695 PyObject *__pyx_r = NULL;
15696 __Pyx_RefNannyDeclarations
15697 npy_intp __pyx_t_1;
15698 npy_intp __pyx_t_2;
15700 npy_intp __pyx_t_4;
15701 npy_intp __pyx_t_5;
15703 npy_intp __pyx_t_7;
15704 npy_intp __pyx_t_8;
15706 npy_intp __pyx_t_10;
15707 npy_intp __pyx_t_11;
15708 npy_intp __pyx_t_12;
15709 Py_ssize_t __pyx_t_13;
15710 Py_ssize_t __pyx_t_14;
15711 Py_ssize_t __pyx_t_15;
15712 Py_ssize_t __pyx_t_16;
15714 Py_ssize_t __pyx_t_18;
15715 Py_ssize_t __pyx_t_19;
15716 Py_ssize_t __pyx_t_20;
15717 Py_ssize_t __pyx_t_21;
15718 Py_ssize_t __pyx_t_22;
15719 Py_ssize_t __pyx_t_23;
15720 Py_ssize_t __pyx_t_24;
15721 int __pyx_lineno = 0;
15722 const char *__pyx_filename = NULL;
15723 int __pyx_clineno = 0;
15724 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15725 __pyx_pybuffer_v.pybuffer.buf = NULL;
15726 __pyx_pybuffer_v.refcount = 0;
15727 __pyx_pybuffernd_v.data = NULL;
15728 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15729 __pyx_pybuffer_n.pybuffer.buf = NULL;
15730 __pyx_pybuffer_n.refcount = 0;
15731 __pyx_pybuffernd_n.data = NULL;
15732 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15733 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15734 __pyx_pybuffer_dS.refcount = 0;
15735 __pyx_pybuffernd_dS.data = NULL;
15736 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15737 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15738 __pyx_pybuffer_flux.refcount = 0;
15739 __pyx_pybuffernd_flux.data = NULL;
15740 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15742 __Pyx_BufFmt_StackElem __pyx_stack[1];
15743 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15745 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15747 __Pyx_BufFmt_StackElem __pyx_stack[1];
15748 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15750 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15752 __Pyx_BufFmt_StackElem __pyx_stack[1];
15753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15755 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15757 __Pyx_BufFmt_StackElem __pyx_stack[1];
15758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15760 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15769 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15770 __pyx_t_2 = __pyx_t_1;
15771 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15772 __pyx_v_eN = __pyx_t_3;
15781 __pyx_t_4 = (__pyx_v_n->dimensions[1]);
15782 __pyx_t_5 = __pyx_t_4;
15783 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15784 __pyx_v_ebN = __pyx_t_6;
15793 __pyx_v_integral = 0.0;
15802 __pyx_t_7 = (__pyx_v_n->dimensions[2]);
15803 __pyx_t_8 = __pyx_t_7;
15804 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
15805 __pyx_v_kb = __pyx_t_9;
15814 __pyx_t_10 = (__pyx_v_n->dimensions[3]);
15815 __pyx_t_11 = __pyx_t_10;
15816 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
15817 __pyx_v_I = __pyx_t_12;
15826 __pyx_t_13 = __pyx_v_eN;
15827 __pyx_t_14 = __pyx_v_ebN;
15828 __pyx_t_15 = __pyx_v_kb;
15829 __pyx_t_16 = __pyx_v_I;
15831 if (__pyx_t_13 < 0) {
15832 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
15833 if (unlikely(__pyx_t_13 < 0)) __pyx_t_17 = 0;
15834 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_17 = 0;
15835 if (__pyx_t_14 < 0) {
15836 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
15837 if (unlikely(__pyx_t_14 < 0)) __pyx_t_17 = 1;
15838 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_17 = 1;
15839 if (__pyx_t_15 < 0) {
15840 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
15841 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 2;
15842 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_17 = 2;
15843 if (__pyx_t_16 < 0) {
15844 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
15845 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 3;
15846 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_17 = 3;
15847 if (unlikely(__pyx_t_17 != -1)) {
15848 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15849 __PYX_ERR(0, 729, __pyx_L1_error)
15851 __pyx_t_18 = __pyx_v_eN;
15852 __pyx_t_19 = __pyx_v_ebN;
15853 __pyx_t_20 = __pyx_v_kb;
15854 __pyx_t_21 = __pyx_v_I;
15856 if (__pyx_t_18 < 0) {
15857 __pyx_t_18 += __pyx_pybuffernd_n.diminfo[0].shape;
15858 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
15859 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_17 = 0;
15860 if (__pyx_t_19 < 0) {
15861 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[1].shape;
15862 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 1;
15863 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_17 = 1;
15864 if (__pyx_t_20 < 0) {
15865 __pyx_t_20 += __pyx_pybuffernd_n.diminfo[2].shape;
15866 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 2;
15867 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_17 = 2;
15868 if (__pyx_t_21 < 0) {
15869 __pyx_t_21 += __pyx_pybuffernd_n.diminfo[3].shape;
15870 if (unlikely(__pyx_t_21 < 0)) __pyx_t_17 = 3;
15871 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_17 = 3;
15872 if (unlikely(__pyx_t_17 != -1)) {
15873 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15874 __PYX_ERR(0, 729, __pyx_L1_error)
15876 __pyx_t_22 = __pyx_v_eN;
15877 __pyx_t_23 = __pyx_v_ebN;
15878 __pyx_t_24 = __pyx_v_kb;
15880 if (__pyx_t_22 < 0) {
15881 __pyx_t_22 += __pyx_pybuffernd_dS.diminfo[0].shape;
15882 if (unlikely(__pyx_t_22 < 0)) __pyx_t_17 = 0;
15883 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_17 = 0;
15884 if (__pyx_t_23 < 0) {
15885 __pyx_t_23 += __pyx_pybuffernd_dS.diminfo[1].shape;
15886 if (unlikely(__pyx_t_23 < 0)) __pyx_t_17 = 1;
15887 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_17 = 1;
15888 if (__pyx_t_24 < 0) {
15889 __pyx_t_24 += __pyx_pybuffernd_dS.diminfo[2].shape;
15890 if (unlikely(__pyx_t_24 < 0)) __pyx_t_17 = 2;
15891 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_17 = 2;
15892 if (unlikely(__pyx_t_17 != -1)) {
15893 __Pyx_RaiseBufferIndexError(__pyx_t_17);
15894 __PYX_ERR(0, 729, __pyx_L1_error)
15896 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_21, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_dS.diminfo[2].strides))));
15907 __pyx_t_24 = __pyx_v_eN;
15908 __pyx_t_23 = __pyx_v_ebN;
15910 if (__pyx_t_24 < 0) {
15911 __pyx_t_24 += __pyx_pybuffernd_flux.diminfo[0].shape;
15912 if (unlikely(__pyx_t_24 < 0)) __pyx_t_9 = 0;
15913 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_9 = 0;
15914 if (__pyx_t_23 < 0) {
15915 __pyx_t_23 += __pyx_pybuffernd_flux.diminfo[1].shape;
15916 if (unlikely(__pyx_t_23 < 0)) __pyx_t_9 = 1;
15917 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_9 = 1;
15918 if (unlikely(__pyx_t_9 != -1)) {
15919 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15920 __PYX_ERR(0, 730, __pyx_L1_error)
15922 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
15935 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15938 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15939 __Pyx_PyThreadState_declare
15940 __Pyx_PyThreadState_assign
15941 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15942 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15943 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15944 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15945 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15946 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15947 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15951 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15952 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15953 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15954 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15956 __Pyx_XGIVEREF(__pyx_r);
15957 __Pyx_RefNannyFinishContext();
15970 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15971 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
15972 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
15973 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15974 PyArrayObject *__pyx_v_df = 0;
15975 PyArrayObject *__pyx_v_characteristic_velocity = 0;
15976 PyArrayObject *__pyx_v_dm = 0;
15977 PyArrayObject *__pyx_v_dV = 0;
15978 int __pyx_lineno = 0;
15979 const char *__pyx_filename = NULL;
15980 int __pyx_clineno = 0;
15981 PyObject *__pyx_r = 0;
15982 __Pyx_RefNannyDeclarations
15983 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
15985 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
15986 PyObject* values[4] = {0,0,0,0};
15987 if (unlikely(__pyx_kwds)) {
15988 Py_ssize_t kw_args;
15989 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15990 switch (pos_args) {
15991 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15992 CYTHON_FALLTHROUGH;
15993 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15994 CYTHON_FALLTHROUGH;
15995 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15996 CYTHON_FALLTHROUGH;
15997 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15998 CYTHON_FALLTHROUGH;
16000 default:
goto __pyx_L5_argtuple_error;
16002 kw_args = PyDict_Size(__pyx_kwds);
16003 switch (pos_args) {
16005 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
16006 else goto __pyx_L5_argtuple_error;
16007 CYTHON_FALLTHROUGH;
16009 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
16011 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
16013 CYTHON_FALLTHROUGH;
16015 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16017 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
16019 CYTHON_FALLTHROUGH;
16021 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16023 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
16026 if (unlikely(kw_args > 0)) {
16027 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
16029 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
16030 goto __pyx_L5_argtuple_error;
16032 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16033 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16034 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16035 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16037 __pyx_v_df = ((PyArrayObject *)values[0]);
16038 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
16039 __pyx_v_dm = ((PyArrayObject *)values[2]);
16040 __pyx_v_dV = ((PyArrayObject *)values[3]);
16042 goto __pyx_L4_argument_unpacking_done;
16043 __pyx_L5_argtuple_error:;
16044 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
16046 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16047 __Pyx_RefNannyFinishContext();
16049 __pyx_L4_argument_unpacking_done:;
16050 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
16051 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
16052 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
16053 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
16054 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
16061 __Pyx_RefNannyFinishContext();
16065 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16069 double __pyx_v_omega_e;
16070 double __pyx_v_vol_e;
16071 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
16072 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
16073 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16074 __Pyx_Buffer __pyx_pybuffer_dV;
16075 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
16076 __Pyx_Buffer __pyx_pybuffer_df;
16077 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16078 __Pyx_Buffer __pyx_pybuffer_dm;
16079 PyObject *__pyx_r = NULL;
16080 __Pyx_RefNannyDeclarations
16081 npy_intp __pyx_t_1;
16082 npy_intp __pyx_t_2;
16084 npy_intp __pyx_t_4;
16085 npy_intp __pyx_t_5;
16087 Py_ssize_t __pyx_t_7;
16088 Py_ssize_t __pyx_t_8;
16090 Py_ssize_t __pyx_t_10;
16091 Py_ssize_t __pyx_t_11;
16092 npy_intp __pyx_t_12;
16093 npy_intp __pyx_t_13;
16095 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
16097 int __pyx_lineno = 0;
16098 const char *__pyx_filename = NULL;
16099 int __pyx_clineno = 0;
16100 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
16101 __pyx_pybuffer_df.pybuffer.buf = NULL;
16102 __pyx_pybuffer_df.refcount = 0;
16103 __pyx_pybuffernd_df.data = NULL;
16104 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
16105 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
16106 __pyx_pybuffer_characteristic_velocity.refcount = 0;
16107 __pyx_pybuffernd_characteristic_velocity.data = NULL;
16108 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
16109 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16110 __pyx_pybuffer_dm.refcount = 0;
16111 __pyx_pybuffernd_dm.data = NULL;
16112 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16113 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16114 __pyx_pybuffer_dV.refcount = 0;
16115 __pyx_pybuffernd_dV.data = NULL;
16116 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16118 __Pyx_BufFmt_StackElem __pyx_stack[1];
16119 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16121 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
16123 __Pyx_BufFmt_StackElem __pyx_stack[1];
16124 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16126 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
16128 __Pyx_BufFmt_StackElem __pyx_stack[1];
16129 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16131 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16133 __Pyx_BufFmt_StackElem __pyx_stack[1];
16134 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
16136 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16145 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16146 __pyx_t_2 = __pyx_t_1;
16147 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16148 __pyx_v_eN = __pyx_t_3;
16157 __pyx_v_omega_e = 0.0;
16166 __pyx_v_vol_e = 0.0;
16175 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16176 __pyx_t_5 = __pyx_t_4;
16177 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16178 __pyx_v_k = __pyx_t_6;
16187 __pyx_t_7 = __pyx_v_eN;
16188 __pyx_t_8 = __pyx_v_k;
16190 if (__pyx_t_7 < 0) {
16191 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16192 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16193 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16194 if (__pyx_t_8 < 0) {
16195 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16196 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16197 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16198 if (unlikely(__pyx_t_9 != -1)) {
16199 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16200 __PYX_ERR(0, 747, __pyx_L1_error)
16202 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16211 __pyx_t_8 = __pyx_v_eN;
16212 __pyx_t_7 = __pyx_v_k;
16214 if (__pyx_t_8 < 0) {
16215 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16216 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16217 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16218 if (__pyx_t_7 < 0) {
16219 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16220 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16221 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16222 if (unlikely(__pyx_t_9 != -1)) {
16223 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16224 __PYX_ERR(0, 748, __pyx_L1_error)
16226 __pyx_t_10 = __pyx_v_eN;
16227 __pyx_t_11 = __pyx_v_k;
16229 if (__pyx_t_10 < 0) {
16230 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16231 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16232 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16233 if (__pyx_t_11 < 0) {
16234 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16235 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16236 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16237 if (unlikely(__pyx_t_9 != -1)) {
16238 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16239 __PYX_ERR(0, 748, __pyx_L1_error)
16241 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16251 __pyx_t_4 = (__pyx_v_df->dimensions[1]);
16252 __pyx_t_5 = __pyx_t_4;
16253 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16254 __pyx_v_k = __pyx_t_6;
16263 __pyx_t_12 = (__pyx_v_df->dimensions[2]);
16264 __pyx_t_13 = __pyx_t_12;
16265 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_13; __pyx_t_9+=1) {
16266 __pyx_v_I = __pyx_t_9;
16275 __pyx_t_11 = __pyx_v_eN;
16276 __pyx_t_10 = __pyx_v_k;
16277 __pyx_t_7 = __pyx_v_I;
16279 if (__pyx_t_11 < 0) {
16280 __pyx_t_11 += __pyx_pybuffernd_df.diminfo[0].shape;
16281 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 0;
16282 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_14 = 0;
16283 if (__pyx_t_10 < 0) {
16284 __pyx_t_10 += __pyx_pybuffernd_df.diminfo[1].shape;
16285 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16286 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_14 = 1;
16287 if (__pyx_t_7 < 0) {
16288 __pyx_t_7 += __pyx_pybuffernd_df.diminfo[2].shape;
16289 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 2;
16290 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_14 = 2;
16291 if (unlikely(__pyx_t_14 != -1)) {
16292 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16293 __PYX_ERR(0, 751, __pyx_L1_error)
16295 __pyx_t_15 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
16296 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
16297 if (unlikely(__pyx_t_16 == 0)) {
16298 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16299 __PYX_ERR(0, 751, __pyx_L1_error)
16301 __pyx_t_7 = __pyx_v_eN;
16302 __pyx_t_10 = __pyx_v_k;
16303 __pyx_t_11 = __pyx_v_I;
16305 if (__pyx_t_7 < 0) {
16306 __pyx_t_7 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
16307 if (unlikely(__pyx_t_7 < 0)) __pyx_t_14 = 0;
16308 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_14 = 0;
16309 if (__pyx_t_10 < 0) {
16310 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
16311 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 1;
16312 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_14 = 1;
16313 if (__pyx_t_11 < 0) {
16314 __pyx_t_11 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
16315 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
16316 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_14 = 2;
16317 if (unlikely(__pyx_t_14 != -1)) {
16318 __Pyx_RaiseBufferIndexError(__pyx_t_14);
16319 __PYX_ERR(0, 751, __pyx_L1_error)
16321 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_15 / __pyx_t_16);
16335 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16338 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16339 __Pyx_PyThreadState_declare
16340 __Pyx_PyThreadState_assign
16341 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16342 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16343 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16344 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16345 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16346 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16347 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
16351 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
16352 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16353 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
16354 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16356 __Pyx_XGIVEREF(__pyx_r);
16357 __Pyx_RefNannyFinishContext();
16370 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16371 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
16372 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
16373 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16374 PyArrayObject *__pyx_v_df_dofs = 0;
16375 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
16376 PyArrayObject *__pyx_v_l2g = 0;
16377 PyArrayObject *__pyx_v_dm = 0;
16378 PyArrayObject *__pyx_v_dV = 0;
16379 int __pyx_lineno = 0;
16380 const char *__pyx_filename = NULL;
16381 int __pyx_clineno = 0;
16382 PyObject *__pyx_r = 0;
16383 __Pyx_RefNannyDeclarations
16384 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
16386 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
16387 PyObject* values[5] = {0,0,0,0,0};
16388 if (unlikely(__pyx_kwds)) {
16389 Py_ssize_t kw_args;
16390 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16391 switch (pos_args) {
16392 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16393 CYTHON_FALLTHROUGH;
16394 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16395 CYTHON_FALLTHROUGH;
16396 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16397 CYTHON_FALLTHROUGH;
16398 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16399 CYTHON_FALLTHROUGH;
16400 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16401 CYTHON_FALLTHROUGH;
16403 default:
goto __pyx_L5_argtuple_error;
16405 kw_args = PyDict_Size(__pyx_kwds);
16406 switch (pos_args) {
16408 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
16409 else goto __pyx_L5_argtuple_error;
16410 CYTHON_FALLTHROUGH;
16412 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
16414 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
16416 CYTHON_FALLTHROUGH;
16418 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
16420 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
16422 CYTHON_FALLTHROUGH;
16424 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
16426 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
16428 CYTHON_FALLTHROUGH;
16430 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
16432 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
16435 if (unlikely(kw_args > 0)) {
16436 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
16438 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
16439 goto __pyx_L5_argtuple_error;
16441 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16442 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16443 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16444 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16445 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16447 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
16448 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
16449 __pyx_v_l2g = ((PyArrayObject *)values[2]);
16450 __pyx_v_dm = ((PyArrayObject *)values[3]);
16451 __pyx_v_dV = ((PyArrayObject *)values[4]);
16453 goto __pyx_L4_argument_unpacking_done;
16454 __pyx_L5_argtuple_error:;
16455 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
16457 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16458 __Pyx_RefNannyFinishContext();
16460 __pyx_L4_argument_unpacking_done:;
16461 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
16462 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
16463 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
16464 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
16465 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
16466 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
16473 __Pyx_RefNannyFinishContext();
16477 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
16482 double __pyx_v_omega_e;
16483 double __pyx_v_vol_e;
16484 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
16485 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
16486 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
16487 __Pyx_Buffer __pyx_pybuffer_dV;
16488 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
16489 __Pyx_Buffer __pyx_pybuffer_df_dofs;
16490 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
16491 __Pyx_Buffer __pyx_pybuffer_dm;
16492 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
16493 __Pyx_Buffer __pyx_pybuffer_l2g;
16494 PyObject *__pyx_r = NULL;
16495 __Pyx_RefNannyDeclarations
16496 npy_intp __pyx_t_1;
16497 npy_intp __pyx_t_2;
16499 npy_intp __pyx_t_4;
16500 npy_intp __pyx_t_5;
16502 Py_ssize_t __pyx_t_7;
16503 Py_ssize_t __pyx_t_8;
16505 Py_ssize_t __pyx_t_10;
16506 Py_ssize_t __pyx_t_11;
16507 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_12;
16509 int __pyx_lineno = 0;
16510 const char *__pyx_filename = NULL;
16511 int __pyx_clineno = 0;
16512 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
16513 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
16514 __pyx_pybuffer_df_dofs.refcount = 0;
16515 __pyx_pybuffernd_df_dofs.data = NULL;
16516 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
16517 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
16518 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
16519 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
16520 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
16521 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
16522 __pyx_pybuffer_l2g.refcount = 0;
16523 __pyx_pybuffernd_l2g.data = NULL;
16524 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
16525 __pyx_pybuffer_dm.pybuffer.buf = NULL;
16526 __pyx_pybuffer_dm.refcount = 0;
16527 __pyx_pybuffernd_dm.data = NULL;
16528 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
16529 __pyx_pybuffer_dV.pybuffer.buf = NULL;
16530 __pyx_pybuffer_dV.refcount = 0;
16531 __pyx_pybuffernd_dV.data = NULL;
16532 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
16534 __Pyx_BufFmt_StackElem __pyx_stack[1];
16535 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16537 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
16539 __Pyx_BufFmt_StackElem __pyx_stack[1];
16540 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16542 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
16544 __Pyx_BufFmt_StackElem __pyx_stack[1];
16545 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16547 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
16549 __Pyx_BufFmt_StackElem __pyx_stack[1];
16550 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16552 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
16554 __Pyx_BufFmt_StackElem __pyx_stack[1];
16555 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
16557 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
16566 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
16567 __pyx_t_2 = __pyx_t_1;
16568 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16569 __pyx_v_eN = __pyx_t_3;
16578 __pyx_v_omega_e = 0.0;
16587 __pyx_v_vol_e = 0.0;
16596 __pyx_t_4 = (__pyx_v_dm->dimensions[1]);
16597 __pyx_t_5 = __pyx_t_4;
16598 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16599 __pyx_v_k = __pyx_t_6;
16608 __pyx_t_7 = __pyx_v_eN;
16609 __pyx_t_8 = __pyx_v_k;
16611 if (__pyx_t_7 < 0) {
16612 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[0].shape;
16613 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0;
16614 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16615 if (__pyx_t_8 < 0) {
16616 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[1].shape;
16617 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1;
16618 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16619 if (unlikely(__pyx_t_9 != -1)) {
16620 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16621 __PYX_ERR(0, 769, __pyx_L1_error)
16623 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[1].strides)));
16632 __pyx_t_8 = __pyx_v_eN;
16633 __pyx_t_7 = __pyx_v_k;
16635 if (__pyx_t_8 < 0) {
16636 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16637 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
16638 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_9 = 0;
16639 if (__pyx_t_7 < 0) {
16640 __pyx_t_7 += __pyx_pybuffernd_dV.diminfo[1].shape;
16641 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16642 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_9 = 1;
16643 if (unlikely(__pyx_t_9 != -1)) {
16644 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16645 __PYX_ERR(0, 770, __pyx_L1_error)
16647 __pyx_t_10 = __pyx_v_eN;
16648 __pyx_t_11 = __pyx_v_k;
16650 if (__pyx_t_10 < 0) {
16651 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16652 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16653 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_9 = 0;
16654 if (__pyx_t_11 < 0) {
16655 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16656 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16657 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_9 = 1;
16658 if (unlikely(__pyx_t_9 != -1)) {
16659 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16660 __PYX_ERR(0, 770, __pyx_L1_error)
16662 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16672 __pyx_t_4 = (__pyx_v_l2g->dimensions[1]);
16673 __pyx_t_5 = __pyx_t_4;
16674 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16675 __pyx_v_j = __pyx_t_6;
16684 __pyx_t_11 = __pyx_v_eN;
16685 __pyx_t_10 = __pyx_v_j;
16687 if (__pyx_t_11 < 0) {
16688 __pyx_t_11 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16689 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 0;
16690 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_9 = 0;
16691 if (__pyx_t_10 < 0) {
16692 __pyx_t_10 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16693 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 1;
16694 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_9 = 1;
16695 if (unlikely(__pyx_t_9 != -1)) {
16696 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16697 __PYX_ERR(0, 772, __pyx_L1_error)
16699 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_l2g.diminfo[1].strides));
16708 __pyx_t_10 = __pyx_v_J;
16710 if (__pyx_t_10 < 0) {
16711 __pyx_t_10 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16712 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16713 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16714 if (unlikely(__pyx_t_9 != -1)) {
16715 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16716 __PYX_ERR(0, 773, __pyx_L1_error)
16718 __pyx_t_12 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16719 __pyx_t_13 = (__pyx_v_omega_e + 1.0e-12);
16720 if (unlikely(__pyx_t_13 == 0)) {
16721 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16722 __PYX_ERR(0, 773, __pyx_L1_error)
16724 __pyx_t_10 = __pyx_v_J;
16726 if (__pyx_t_10 < 0) {
16727 __pyx_t_10 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16728 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16729 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_9 = 0;
16730 if (unlikely(__pyx_t_9 != -1)) {
16731 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16732 __PYX_ERR(0, 773, __pyx_L1_error)
16734 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_12 / __pyx_t_13);
16747 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16750 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16751 __Pyx_PyThreadState_declare
16752 __Pyx_PyThreadState_assign
16753 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16755 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16756 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16757 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16758 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16759 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16760 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16764 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16765 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16766 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16767 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16768 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16770 __Pyx_XGIVEREF(__pyx_r);
16771 __Pyx_RefNannyFinishContext();
16784 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16785 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16786 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16787 int __pyx_v_transient;
16789 double __pyx_v_tForReversal;
16790 double __pyx_v_clock;
16793 PyArrayObject *__pyx_v_x = 0;
16794 PyArrayObject *__pyx_v_v = 0;
16795 double __pyx_v_zvelocity;
16796 int __pyx_lineno = 0;
16797 const char *__pyx_filename = NULL;
16798 int __pyx_clineno = 0;
16799 PyObject *__pyx_r = 0;
16800 __Pyx_RefNannyDeclarations
16801 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16803 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16804 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16805 if (unlikely(__pyx_kwds)) {
16806 Py_ssize_t kw_args;
16807 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16808 switch (pos_args) {
16809 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16810 CYTHON_FALLTHROUGH;
16811 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16812 CYTHON_FALLTHROUGH;
16813 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16814 CYTHON_FALLTHROUGH;
16815 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16816 CYTHON_FALLTHROUGH;
16817 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16818 CYTHON_FALLTHROUGH;
16819 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16820 CYTHON_FALLTHROUGH;
16821 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16822 CYTHON_FALLTHROUGH;
16823 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16824 CYTHON_FALLTHROUGH;
16825 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16826 CYTHON_FALLTHROUGH;
16828 default:
goto __pyx_L5_argtuple_error;
16830 kw_args = PyDict_Size(__pyx_kwds);
16831 switch (pos_args) {
16833 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16834 else goto __pyx_L5_argtuple_error;
16835 CYTHON_FALLTHROUGH;
16837 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16839 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16841 CYTHON_FALLTHROUGH;
16843 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16845 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16847 CYTHON_FALLTHROUGH;
16849 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16851 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16853 CYTHON_FALLTHROUGH;
16855 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16857 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16859 CYTHON_FALLTHROUGH;
16861 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16863 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16865 CYTHON_FALLTHROUGH;
16867 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16869 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16871 CYTHON_FALLTHROUGH;
16873 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16875 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16877 CYTHON_FALLTHROUGH;
16880 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
16881 if (value) { values[8] = value; kw_args--; }
16884 if (unlikely(kw_args > 0)) {
16885 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16888 switch (PyTuple_GET_SIZE(__pyx_args)) {
16889 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16890 CYTHON_FALLTHROUGH;
16891 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16892 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16893 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16894 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16895 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16896 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16897 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16898 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16900 default:
goto __pyx_L5_argtuple_error;
16903 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16904 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16905 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16906 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16907 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16908 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16909 __pyx_v_x = ((PyArrayObject *)values[6]);
16910 __pyx_v_v = ((PyArrayObject *)values[7]);
16912 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16914 __pyx_v_zvelocity = ((double)0.0);
16917 goto __pyx_L4_argument_unpacking_done;
16918 __pyx_L5_argtuple_error:;
16919 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
16921 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16922 __Pyx_RefNannyFinishContext();
16924 __pyx_L4_argument_unpacking_done:;
16925 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
16926 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
16927 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
16934 __Pyx_RefNannyFinishContext();
16938 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
16942 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
16943 __Pyx_Buffer __pyx_pybuffer_v;
16944 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
16945 __Pyx_Buffer __pyx_pybuffer_x;
16946 PyObject *__pyx_r = NULL;
16947 __Pyx_RefNannyDeclarations
16949 npy_intp __pyx_t_2;
16950 npy_intp __pyx_t_3;
16952 npy_intp __pyx_t_5;
16953 npy_intp __pyx_t_6;
16955 Py_ssize_t __pyx_t_8;
16956 Py_ssize_t __pyx_t_9;
16957 Py_ssize_t __pyx_t_10;
16959 Py_ssize_t __pyx_t_12;
16960 Py_ssize_t __pyx_t_13;
16961 Py_ssize_t __pyx_t_14;
16962 PyObject *__pyx_t_15 = NULL;
16963 PyObject *__pyx_t_16 = NULL;
16964 PyObject *__pyx_t_17 = NULL;
16967 PyObject *__pyx_t_20 = NULL;
16968 int __pyx_lineno = 0;
16969 const char *__pyx_filename = NULL;
16970 int __pyx_clineno = 0;
16971 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
16972 __pyx_pybuffer_x.pybuffer.buf = NULL;
16973 __pyx_pybuffer_x.refcount = 0;
16974 __pyx_pybuffernd_x.data = NULL;
16975 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
16976 __pyx_pybuffer_v.pybuffer.buf = NULL;
16977 __pyx_pybuffer_v.refcount = 0;
16978 __pyx_pybuffernd_v.data = NULL;
16979 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
16981 __Pyx_BufFmt_StackElem __pyx_stack[1];
16982 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16984 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
16986 __Pyx_BufFmt_StackElem __pyx_stack[1];
16987 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16989 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17007 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
17017 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17027 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17028 __pyx_t_3 = __pyx_t_2;
17029 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17030 __pyx_v_eN = __pyx_t_4;
17039 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17040 __pyx_t_6 = __pyx_t_5;
17041 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17042 __pyx_v_k = __pyx_t_7;
17051 __pyx_t_8 = __pyx_v_eN;
17052 __pyx_t_9 = __pyx_v_k;
17055 if (__pyx_t_8 < 0) {
17056 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17057 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17058 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17059 if (__pyx_t_9 < 0) {
17060 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17061 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17062 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17063 if (__pyx_t_10 < 0) {
17064 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17065 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17066 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17067 if (unlikely(__pyx_t_11 != -1)) {
17068 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17069 __PYX_ERR(0, 791, __pyx_L1_error)
17071 __pyx_t_12 = __pyx_v_eN;
17072 __pyx_t_13 = __pyx_v_k;
17075 if (__pyx_t_12 < 0) {
17076 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17077 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17078 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17079 if (__pyx_t_13 < 0) {
17080 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17081 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17082 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17083 if (__pyx_t_14 < 0) {
17084 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17085 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17086 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17087 if (unlikely(__pyx_t_11 != -1)) {
17088 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17089 __PYX_ERR(0, 791, __pyx_L1_error)
17091 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17100 __pyx_t_10 = __pyx_v_eN;
17101 __pyx_t_9 = __pyx_v_k;
17104 if (__pyx_t_10 < 0) {
17105 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17106 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17107 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17108 if (__pyx_t_9 < 0) {
17109 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17110 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17111 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17112 if (__pyx_t_8 < 0) {
17113 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17114 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17115 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17116 if (unlikely(__pyx_t_11 != -1)) {
17117 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17118 __PYX_ERR(0, 792, __pyx_L1_error)
17120 __pyx_t_14 = __pyx_v_eN;
17121 __pyx_t_13 = __pyx_v_k;
17124 if (__pyx_t_14 < 0) {
17125 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17126 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17127 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17128 if (__pyx_t_13 < 0) {
17129 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17130 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17131 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17132 if (__pyx_t_12 < 0) {
17133 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17134 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17135 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17136 if (unlikely(__pyx_t_11 != -1)) {
17137 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17138 __PYX_ERR(0, 792, __pyx_L1_error)
17140 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17149 __pyx_t_8 = __pyx_v_eN;
17150 __pyx_t_9 = __pyx_v_k;
17153 if (__pyx_t_8 < 0) {
17154 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
17155 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17156 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17157 if (__pyx_t_9 < 0) {
17158 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17159 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17160 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17161 if (__pyx_t_10 < 0) {
17162 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
17163 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17164 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17165 if (unlikely(__pyx_t_11 != -1)) {
17166 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17167 __PYX_ERR(0, 793, __pyx_L1_error)
17169 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17178 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17179 __Pyx_GOTREF(__pyx_t_15);
17180 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17181 __Pyx_GOTREF(__pyx_t_16);
17182 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 794, __pyx_L1_error)
17183 __Pyx_GOTREF(__pyx_t_17);
17184 __Pyx_GIVEREF(__pyx_t_15);
17185 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
17186 __Pyx_GIVEREF(__pyx_t_16);
17187 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
17188 __Pyx_INCREF(__pyx_slice_);
17189 __Pyx_GIVEREF(__pyx_slice_);
17190 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
17193 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 794, __pyx_L1_error)
17194 __Pyx_GOTREF(__pyx_t_16);
17195 __pyx_t_18 = (__pyx_v_tForReversal - __pyx_v_t);
17196 __pyx_t_19 = (__pyx_v_tForReversal - 0.0);
17197 if (unlikely(__pyx_t_19 == 0)) {
17198 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17199 __PYX_ERR(0, 794, __pyx_L1_error)
17201 __pyx_t_15 = PyFloat_FromDouble(((__pyx_t_18 / __pyx_t_19) * __pyx_v_clock));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 794, __pyx_L1_error)
17202 __Pyx_GOTREF(__pyx_t_15);
17203 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 794, __pyx_L1_error)
17204 __Pyx_GOTREF(__pyx_t_20);
17205 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17206 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17207 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
17208 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17209 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17231 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17232 __pyx_t_3 = __pyx_t_2;
17233 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17234 __pyx_v_eN = __pyx_t_4;
17243 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17244 __pyx_t_6 = __pyx_t_5;
17245 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17246 __pyx_v_k = __pyx_t_7;
17255 __pyx_t_10 = __pyx_v_eN;
17256 __pyx_t_9 = __pyx_v_k;
17259 if (__pyx_t_10 < 0) {
17260 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17261 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17262 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17263 if (__pyx_t_9 < 0) {
17264 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17265 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17266 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17267 if (__pyx_t_8 < 0) {
17268 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17269 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17270 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17271 if (unlikely(__pyx_t_11 != -1)) {
17272 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17273 __PYX_ERR(0, 798, __pyx_L1_error)
17275 __pyx_t_12 = __pyx_v_eN;
17276 __pyx_t_13 = __pyx_v_k;
17279 if (__pyx_t_12 < 0) {
17280 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17281 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17282 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17283 if (__pyx_t_13 < 0) {
17284 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17285 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17286 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17287 if (__pyx_t_14 < 0) {
17288 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17289 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17290 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17291 if (unlikely(__pyx_t_11 != -1)) {
17292 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17293 __PYX_ERR(0, 798, __pyx_L1_error)
17295 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17304 __pyx_t_8 = __pyx_v_eN;
17305 __pyx_t_9 = __pyx_v_k;
17308 if (__pyx_t_8 < 0) {
17309 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17310 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17311 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17312 if (__pyx_t_9 < 0) {
17313 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17314 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17315 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17316 if (__pyx_t_10 < 0) {
17317 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17318 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17319 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17320 if (unlikely(__pyx_t_11 != -1)) {
17321 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17322 __PYX_ERR(0, 799, __pyx_L1_error)
17324 __pyx_t_14 = __pyx_v_eN;
17325 __pyx_t_13 = __pyx_v_k;
17328 if (__pyx_t_14 < 0) {
17329 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17330 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17331 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17332 if (__pyx_t_13 < 0) {
17333 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17334 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17335 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17336 if (__pyx_t_12 < 0) {
17337 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17338 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17339 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17340 if (unlikely(__pyx_t_11 != -1)) {
17341 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17342 __PYX_ERR(0, 799, __pyx_L1_error)
17344 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
17353 __pyx_t_10 = __pyx_v_eN;
17354 __pyx_t_9 = __pyx_v_k;
17357 if (__pyx_t_10 < 0) {
17358 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
17359 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17360 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17361 if (__pyx_t_9 < 0) {
17362 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
17363 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17364 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17365 if (__pyx_t_8 < 0) {
17366 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
17367 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17368 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17369 if (unlikely(__pyx_t_11 != -1)) {
17370 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17371 __PYX_ERR(0, 800, __pyx_L1_error)
17373 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
17397 #ifndef CYTHON_WITHOUT_ASSERTIONS
17398 if (unlikely(!Py_OptimizeFlag)) {
17399 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
17400 PyErr_SetNone(PyExc_AssertionError);
17401 __PYX_ERR(0, 802, __pyx_L1_error)
17413 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17423 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17424 __pyx_t_3 = __pyx_t_2;
17425 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17426 __pyx_v_eN = __pyx_t_4;
17435 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17436 __pyx_t_6 = __pyx_t_5;
17437 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17438 __pyx_v_k = __pyx_t_7;
17447 __pyx_t_8 = __pyx_v_eN;
17448 __pyx_t_9 = __pyx_v_k;
17451 if (__pyx_t_8 < 0) {
17452 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17453 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17454 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17455 if (__pyx_t_9 < 0) {
17456 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17457 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17458 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17459 if (__pyx_t_10 < 0) {
17460 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17461 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17462 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17463 if (unlikely(__pyx_t_11 != -1)) {
17464 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17465 __PYX_ERR(0, 806, __pyx_L1_error)
17467 __pyx_t_12 = __pyx_v_eN;
17468 __pyx_t_13 = __pyx_v_k;
17471 if (__pyx_t_12 < 0) {
17472 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17473 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17474 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17475 if (__pyx_t_13 < 0) {
17476 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17477 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17478 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17479 if (__pyx_t_14 < 0) {
17480 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17481 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17482 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17483 if (unlikely(__pyx_t_11 != -1)) {
17484 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17485 __PYX_ERR(0, 806, __pyx_L1_error)
17487 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17496 __pyx_t_10 = __pyx_v_eN;
17497 __pyx_t_9 = __pyx_v_k;
17500 if (__pyx_t_10 < 0) {
17501 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17502 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17503 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17504 if (__pyx_t_9 < 0) {
17505 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17506 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17507 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17508 if (__pyx_t_8 < 0) {
17509 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17510 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17511 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17512 if (unlikely(__pyx_t_11 != -1)) {
17513 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17514 __PYX_ERR(0, 807, __pyx_L1_error)
17516 __pyx_t_14 = __pyx_v_eN;
17517 __pyx_t_13 = __pyx_v_k;
17520 if (__pyx_t_14 < 0) {
17521 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17522 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17523 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17524 if (__pyx_t_13 < 0) {
17525 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17526 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17527 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17528 if (__pyx_t_12 < 0) {
17529 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17530 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17531 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17532 if (unlikely(__pyx_t_11 != -1)) {
17533 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17534 __PYX_ERR(0, 807, __pyx_L1_error)
17536 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17545 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17546 __Pyx_GOTREF(__pyx_t_17);
17547 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17548 __Pyx_GOTREF(__pyx_t_20);
17549 __pyx_t_15 = PyTuple_New(3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 808, __pyx_L1_error)
17550 __Pyx_GOTREF(__pyx_t_15);
17551 __Pyx_GIVEREF(__pyx_t_17);
17552 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17);
17553 __Pyx_GIVEREF(__pyx_t_20);
17554 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_20);
17555 __Pyx_INCREF(__pyx_slice_);
17556 __Pyx_GIVEREF(__pyx_slice_);
17557 PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_slice_);
17560 __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 808, __pyx_L1_error)
17561 __Pyx_GOTREF(__pyx_t_20);
17562 __pyx_t_19 = (__pyx_v_tForReversal - __pyx_v_t);
17563 __pyx_t_18 = (__pyx_v_tForReversal - 0.0);
17564 if (unlikely(__pyx_t_18 == 0)) {
17565 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17566 __PYX_ERR(0, 808, __pyx_L1_error)
17568 __pyx_t_17 = PyFloat_FromDouble(((__pyx_t_19 / __pyx_t_18) * __pyx_v_clock));
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 808, __pyx_L1_error)
17569 __Pyx_GOTREF(__pyx_t_17);
17570 __pyx_t_16 = PyNumber_InPlaceMultiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 808, __pyx_L1_error)
17571 __Pyx_GOTREF(__pyx_t_16);
17572 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
17573 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17574 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_15, __pyx_t_16) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17575 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
17576 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
17598 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17599 __pyx_t_3 = __pyx_t_2;
17600 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17601 __pyx_v_eN = __pyx_t_4;
17610 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
17611 __pyx_t_6 = __pyx_t_5;
17612 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17613 __pyx_v_k = __pyx_t_7;
17622 __pyx_t_8 = __pyx_v_eN;
17623 __pyx_t_9 = __pyx_v_k;
17626 if (__pyx_t_8 < 0) {
17627 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17628 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
17629 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17630 if (__pyx_t_9 < 0) {
17631 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17632 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17633 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17634 if (__pyx_t_10 < 0) {
17635 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17636 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
17637 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17638 if (unlikely(__pyx_t_11 != -1)) {
17639 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17640 __PYX_ERR(0, 812, __pyx_L1_error)
17642 __pyx_t_12 = __pyx_v_eN;
17643 __pyx_t_13 = __pyx_v_k;
17646 if (__pyx_t_12 < 0) {
17647 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
17648 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
17649 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17650 if (__pyx_t_13 < 0) {
17651 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17652 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17653 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17654 if (__pyx_t_14 < 0) {
17655 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
17656 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
17657 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17658 if (unlikely(__pyx_t_11 != -1)) {
17659 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17660 __PYX_ERR(0, 812, __pyx_L1_error)
17662 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17671 __pyx_t_10 = __pyx_v_eN;
17672 __pyx_t_9 = __pyx_v_k;
17675 if (__pyx_t_10 < 0) {
17676 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
17677 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
17678 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
17679 if (__pyx_t_9 < 0) {
17680 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17681 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
17682 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
17683 if (__pyx_t_8 < 0) {
17684 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17685 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
17686 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
17687 if (unlikely(__pyx_t_11 != -1)) {
17688 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17689 __PYX_ERR(0, 813, __pyx_L1_error)
17691 __pyx_t_14 = __pyx_v_eN;
17692 __pyx_t_13 = __pyx_v_k;
17695 if (__pyx_t_14 < 0) {
17696 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
17697 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
17698 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
17699 if (__pyx_t_13 < 0) {
17700 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
17701 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
17702 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
17703 if (__pyx_t_12 < 0) {
17704 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17705 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
17706 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
17707 if (unlikely(__pyx_t_11 != -1)) {
17708 __Pyx_RaiseBufferIndexError(__pyx_t_11);
17709 __PYX_ERR(0, 813, __pyx_L1_error)
17711 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
17728 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17731 __Pyx_XDECREF(__pyx_t_15);
17732 __Pyx_XDECREF(__pyx_t_16);
17733 __Pyx_XDECREF(__pyx_t_17);
17734 __Pyx_XDECREF(__pyx_t_20);
17735 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17736 __Pyx_PyThreadState_declare
17737 __Pyx_PyThreadState_assign
17738 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17739 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17740 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17741 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17742 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17746 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17747 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17749 __Pyx_XGIVEREF(__pyx_r);
17750 __Pyx_RefNannyFinishContext();
17763 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17764 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17765 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17766 int __pyx_v_transient;
17768 double __pyx_v_tForReversal;
17769 double __pyx_v_clock;
17772 PyArrayObject *__pyx_v_x = 0;
17773 PyArrayObject *__pyx_v_v = 0;
17774 double __pyx_v_zvelocity;
17775 int __pyx_lineno = 0;
17776 const char *__pyx_filename = NULL;
17777 int __pyx_clineno = 0;
17778 PyObject *__pyx_r = 0;
17779 __Pyx_RefNannyDeclarations
17780 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17782 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17783 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17784 if (unlikely(__pyx_kwds)) {
17785 Py_ssize_t kw_args;
17786 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17787 switch (pos_args) {
17788 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17789 CYTHON_FALLTHROUGH;
17790 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17791 CYTHON_FALLTHROUGH;
17792 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17793 CYTHON_FALLTHROUGH;
17794 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17795 CYTHON_FALLTHROUGH;
17796 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17797 CYTHON_FALLTHROUGH;
17798 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17799 CYTHON_FALLTHROUGH;
17800 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17801 CYTHON_FALLTHROUGH;
17802 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17803 CYTHON_FALLTHROUGH;
17804 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17805 CYTHON_FALLTHROUGH;
17807 default:
goto __pyx_L5_argtuple_error;
17809 kw_args = PyDict_Size(__pyx_kwds);
17810 switch (pos_args) {
17812 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17813 else goto __pyx_L5_argtuple_error;
17814 CYTHON_FALLTHROUGH;
17816 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17818 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17820 CYTHON_FALLTHROUGH;
17822 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17824 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17826 CYTHON_FALLTHROUGH;
17828 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17830 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17832 CYTHON_FALLTHROUGH;
17834 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17836 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17838 CYTHON_FALLTHROUGH;
17840 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17842 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17844 CYTHON_FALLTHROUGH;
17846 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17848 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17850 CYTHON_FALLTHROUGH;
17852 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17854 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17856 CYTHON_FALLTHROUGH;
17859 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zvelocity);
17860 if (value) { values[8] = value; kw_args--; }
17863 if (unlikely(kw_args > 0)) {
17864 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17867 switch (PyTuple_GET_SIZE(__pyx_args)) {
17868 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17869 CYTHON_FALLTHROUGH;
17870 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17871 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17872 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17873 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17874 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17875 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17876 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17877 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17879 default:
goto __pyx_L5_argtuple_error;
17882 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
17883 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
17884 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
17885 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
17886 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17887 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17888 __pyx_v_x = ((PyArrayObject *)values[6]);
17889 __pyx_v_v = ((PyArrayObject *)values[7]);
17891 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
17893 __pyx_v_zvelocity = ((double)0.0);
17896 goto __pyx_L4_argument_unpacking_done;
17897 __pyx_L5_argtuple_error:;
17898 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
17900 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17901 __Pyx_RefNannyFinishContext();
17903 __pyx_L4_argument_unpacking_done:;
17904 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
17905 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
17906 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17913 __Pyx_RefNannyFinishContext();
17917 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
17922 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17923 __Pyx_Buffer __pyx_pybuffer_v;
17924 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17925 __Pyx_Buffer __pyx_pybuffer_x;
17926 PyObject *__pyx_r = NULL;
17927 __Pyx_RefNannyDeclarations
17929 npy_intp __pyx_t_2;
17930 npy_intp __pyx_t_3;
17932 npy_intp __pyx_t_5;
17933 npy_intp __pyx_t_6;
17935 npy_intp __pyx_t_8;
17936 npy_intp __pyx_t_9;
17938 Py_ssize_t __pyx_t_11;
17939 Py_ssize_t __pyx_t_12;
17940 Py_ssize_t __pyx_t_13;
17941 Py_ssize_t __pyx_t_14;
17943 Py_ssize_t __pyx_t_16;
17944 Py_ssize_t __pyx_t_17;
17945 Py_ssize_t __pyx_t_18;
17946 Py_ssize_t __pyx_t_19;
17947 PyObject *__pyx_t_20 = NULL;
17948 PyObject *__pyx_t_21 = NULL;
17949 PyObject *__pyx_t_22 = NULL;
17950 PyObject *__pyx_t_23 = NULL;
17953 int __pyx_lineno = 0;
17954 const char *__pyx_filename = NULL;
17955 int __pyx_clineno = 0;
17956 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
17957 __pyx_pybuffer_x.pybuffer.buf = NULL;
17958 __pyx_pybuffer_x.refcount = 0;
17959 __pyx_pybuffernd_x.data = NULL;
17960 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17961 __pyx_pybuffer_v.pybuffer.buf = NULL;
17962 __pyx_pybuffer_v.refcount = 0;
17963 __pyx_pybuffernd_v.data = NULL;
17964 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17966 __Pyx_BufFmt_StackElem __pyx_stack[1];
17967 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17969 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
17971 __Pyx_BufFmt_StackElem __pyx_stack[1];
17972 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17974 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
17992 __pyx_t_1 = (((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 3) != 0);
18002 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18012 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18013 __pyx_t_3 = __pyx_t_2;
18014 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18015 __pyx_v_eN = __pyx_t_4;
18024 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18025 __pyx_t_6 = __pyx_t_5;
18026 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18027 __pyx_v_ebN = __pyx_t_7;
18036 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18037 __pyx_t_9 = __pyx_t_8;
18038 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18039 __pyx_v_k = __pyx_t_10;
18048 __pyx_t_11 = __pyx_v_eN;
18049 __pyx_t_12 = __pyx_v_ebN;
18050 __pyx_t_13 = __pyx_v_k;
18053 if (__pyx_t_11 < 0) {
18054 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18055 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18056 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18057 if (__pyx_t_12 < 0) {
18058 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18059 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18060 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18061 if (__pyx_t_13 < 0) {
18062 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18063 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18064 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18065 if (__pyx_t_14 < 0) {
18066 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18067 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18068 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18069 if (unlikely(__pyx_t_15 != -1)) {
18070 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18071 __PYX_ERR(0, 832, __pyx_L1_error)
18073 __pyx_t_16 = __pyx_v_eN;
18074 __pyx_t_17 = __pyx_v_ebN;
18075 __pyx_t_18 = __pyx_v_k;
18078 if (__pyx_t_16 < 0) {
18079 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18080 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18081 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18082 if (__pyx_t_17 < 0) {
18083 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18084 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18085 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18086 if (__pyx_t_18 < 0) {
18087 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18088 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18089 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18090 if (__pyx_t_19 < 0) {
18091 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18092 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18093 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18094 if (unlikely(__pyx_t_15 != -1)) {
18095 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18096 __PYX_ERR(0, 832, __pyx_L1_error)
18098 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18107 __pyx_t_14 = __pyx_v_eN;
18108 __pyx_t_13 = __pyx_v_ebN;
18109 __pyx_t_12 = __pyx_v_k;
18112 if (__pyx_t_14 < 0) {
18113 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18114 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18115 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18116 if (__pyx_t_13 < 0) {
18117 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18118 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18119 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18120 if (__pyx_t_12 < 0) {
18121 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18122 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18123 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18124 if (__pyx_t_11 < 0) {
18125 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18126 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18127 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18128 if (unlikely(__pyx_t_15 != -1)) {
18129 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18130 __PYX_ERR(0, 833, __pyx_L1_error)
18132 __pyx_t_19 = __pyx_v_eN;
18133 __pyx_t_18 = __pyx_v_ebN;
18134 __pyx_t_17 = __pyx_v_k;
18137 if (__pyx_t_19 < 0) {
18138 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18139 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18140 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18141 if (__pyx_t_18 < 0) {
18142 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18143 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18144 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18145 if (__pyx_t_17 < 0) {
18146 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18147 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18148 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18149 if (__pyx_t_16 < 0) {
18150 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18151 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18152 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18153 if (unlikely(__pyx_t_15 != -1)) {
18154 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18155 __PYX_ERR(0, 833, __pyx_L1_error)
18157 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18166 __pyx_t_11 = __pyx_v_eN;
18167 __pyx_t_12 = __pyx_v_ebN;
18168 __pyx_t_13 = __pyx_v_k;
18171 if (__pyx_t_11 < 0) {
18172 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
18173 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18174 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18175 if (__pyx_t_12 < 0) {
18176 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
18177 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18178 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18179 if (__pyx_t_13 < 0) {
18180 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
18181 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18182 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18183 if (__pyx_t_14 < 0) {
18184 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
18185 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18186 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18187 if (unlikely(__pyx_t_15 != -1)) {
18188 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18189 __PYX_ERR(0, 834, __pyx_L1_error)
18191 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18200 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18201 __Pyx_GOTREF(__pyx_t_20);
18202 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18203 __Pyx_GOTREF(__pyx_t_21);
18204 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18205 __Pyx_GOTREF(__pyx_t_22);
18206 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 835, __pyx_L1_error)
18207 __Pyx_GOTREF(__pyx_t_23);
18208 __Pyx_GIVEREF(__pyx_t_20);
18209 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
18210 __Pyx_GIVEREF(__pyx_t_21);
18211 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
18212 __Pyx_GIVEREF(__pyx_t_22);
18213 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
18214 __Pyx_INCREF(__pyx_slice_);
18215 __Pyx_GIVEREF(__pyx_slice_);
18216 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
18220 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 835, __pyx_L1_error)
18221 __Pyx_GOTREF(__pyx_t_22);
18222 __pyx_t_24 = (__pyx_v_tForReversal - __pyx_v_t);
18223 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
18224 if (unlikely(__pyx_t_25 == 0)) {
18225 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18226 __PYX_ERR(0, 835, __pyx_L1_error)
18228 __pyx_t_21 = PyFloat_FromDouble(((__pyx_t_24 / __pyx_t_25) * __pyx_v_clock));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 835, __pyx_L1_error)
18229 __Pyx_GOTREF(__pyx_t_21);
18230 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 835, __pyx_L1_error)
18231 __Pyx_GOTREF(__pyx_t_20);
18232 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18233 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18234 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
18235 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18236 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18259 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18260 __pyx_t_3 = __pyx_t_2;
18261 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18262 __pyx_v_eN = __pyx_t_4;
18271 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18272 __pyx_t_6 = __pyx_t_5;
18273 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18274 __pyx_v_ebN = __pyx_t_7;
18283 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18284 __pyx_t_9 = __pyx_t_8;
18285 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18286 __pyx_v_k = __pyx_t_10;
18295 __pyx_t_14 = __pyx_v_eN;
18296 __pyx_t_13 = __pyx_v_ebN;
18297 __pyx_t_12 = __pyx_v_k;
18300 if (__pyx_t_14 < 0) {
18301 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18302 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18303 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18304 if (__pyx_t_13 < 0) {
18305 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18306 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18307 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18308 if (__pyx_t_12 < 0) {
18309 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18310 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18311 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18312 if (__pyx_t_11 < 0) {
18313 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18314 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18315 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18316 if (unlikely(__pyx_t_15 != -1)) {
18317 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18318 __PYX_ERR(0, 840, __pyx_L1_error)
18320 __pyx_t_16 = __pyx_v_eN;
18321 __pyx_t_17 = __pyx_v_ebN;
18322 __pyx_t_18 = __pyx_v_k;
18325 if (__pyx_t_16 < 0) {
18326 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18327 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18328 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18329 if (__pyx_t_17 < 0) {
18330 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18331 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18332 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18333 if (__pyx_t_18 < 0) {
18334 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18335 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18336 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18337 if (__pyx_t_19 < 0) {
18338 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18339 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18340 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18341 if (unlikely(__pyx_t_15 != -1)) {
18342 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18343 __PYX_ERR(0, 840, __pyx_L1_error)
18345 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18354 __pyx_t_11 = __pyx_v_eN;
18355 __pyx_t_12 = __pyx_v_ebN;
18356 __pyx_t_13 = __pyx_v_k;
18359 if (__pyx_t_11 < 0) {
18360 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18361 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18362 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18363 if (__pyx_t_12 < 0) {
18364 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18365 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18366 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18367 if (__pyx_t_13 < 0) {
18368 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18369 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18370 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18371 if (__pyx_t_14 < 0) {
18372 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18373 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18374 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18375 if (unlikely(__pyx_t_15 != -1)) {
18376 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18377 __PYX_ERR(0, 841, __pyx_L1_error)
18379 __pyx_t_19 = __pyx_v_eN;
18380 __pyx_t_18 = __pyx_v_ebN;
18381 __pyx_t_17 = __pyx_v_k;
18384 if (__pyx_t_19 < 0) {
18385 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18386 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18387 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18388 if (__pyx_t_18 < 0) {
18389 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18390 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18391 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18392 if (__pyx_t_17 < 0) {
18393 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18394 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18395 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18396 if (__pyx_t_16 < 0) {
18397 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18398 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18399 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18400 if (unlikely(__pyx_t_15 != -1)) {
18401 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18402 __PYX_ERR(0, 841, __pyx_L1_error)
18404 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
18413 __pyx_t_14 = __pyx_v_eN;
18414 __pyx_t_13 = __pyx_v_ebN;
18415 __pyx_t_12 = __pyx_v_k;
18418 if (__pyx_t_14 < 0) {
18419 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
18420 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18421 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18422 if (__pyx_t_13 < 0) {
18423 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
18424 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18425 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18426 if (__pyx_t_12 < 0) {
18427 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
18428 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18429 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18430 if (__pyx_t_11 < 0) {
18431 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
18432 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18433 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18434 if (unlikely(__pyx_t_15 != -1)) {
18435 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18436 __PYX_ERR(0, 842, __pyx_L1_error)
18438 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
18463 #ifndef CYTHON_WITHOUT_ASSERTIONS
18464 if (unlikely(!Py_OptimizeFlag)) {
18465 if (unlikely(!(((__pyx_v_v->dimensions[(__pyx_v_v->nd - 1)]) == 2) != 0))) {
18466 PyErr_SetNone(PyExc_AssertionError);
18467 __PYX_ERR(0, 844, __pyx_L1_error)
18479 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18489 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18490 __pyx_t_3 = __pyx_t_2;
18491 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18492 __pyx_v_eN = __pyx_t_4;
18501 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18502 __pyx_t_6 = __pyx_t_5;
18503 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18504 __pyx_v_ebN = __pyx_t_7;
18513 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18514 __pyx_t_9 = __pyx_t_8;
18515 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18516 __pyx_v_k = __pyx_t_10;
18525 __pyx_t_11 = __pyx_v_eN;
18526 __pyx_t_12 = __pyx_v_ebN;
18527 __pyx_t_13 = __pyx_v_k;
18530 if (__pyx_t_11 < 0) {
18531 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18532 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18533 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18534 if (__pyx_t_12 < 0) {
18535 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18536 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18537 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18538 if (__pyx_t_13 < 0) {
18539 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18540 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18541 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18542 if (__pyx_t_14 < 0) {
18543 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18544 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18545 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18546 if (unlikely(__pyx_t_15 != -1)) {
18547 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18548 __PYX_ERR(0, 849, __pyx_L1_error)
18550 __pyx_t_16 = __pyx_v_eN;
18551 __pyx_t_17 = __pyx_v_ebN;
18552 __pyx_t_18 = __pyx_v_k;
18555 if (__pyx_t_16 < 0) {
18556 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18557 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18558 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18559 if (__pyx_t_17 < 0) {
18560 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18561 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18562 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18563 if (__pyx_t_18 < 0) {
18564 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18565 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18566 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18567 if (__pyx_t_19 < 0) {
18568 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18569 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18570 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18571 if (unlikely(__pyx_t_15 != -1)) {
18572 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18573 __PYX_ERR(0, 849, __pyx_L1_error)
18575 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18584 __pyx_t_14 = __pyx_v_eN;
18585 __pyx_t_13 = __pyx_v_ebN;
18586 __pyx_t_12 = __pyx_v_k;
18589 if (__pyx_t_14 < 0) {
18590 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18591 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18592 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18593 if (__pyx_t_13 < 0) {
18594 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18595 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18596 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18597 if (__pyx_t_12 < 0) {
18598 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18599 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18600 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18601 if (__pyx_t_11 < 0) {
18602 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18603 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18604 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18605 if (unlikely(__pyx_t_15 != -1)) {
18606 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18607 __PYX_ERR(0, 850, __pyx_L1_error)
18609 __pyx_t_19 = __pyx_v_eN;
18610 __pyx_t_18 = __pyx_v_ebN;
18611 __pyx_t_17 = __pyx_v_k;
18614 if (__pyx_t_19 < 0) {
18615 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18616 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18617 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18618 if (__pyx_t_18 < 0) {
18619 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18620 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18621 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18622 if (__pyx_t_17 < 0) {
18623 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18624 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18625 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18626 if (__pyx_t_16 < 0) {
18627 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18628 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18629 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18630 if (unlikely(__pyx_t_15 != -1)) {
18631 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18632 __PYX_ERR(0, 850, __pyx_L1_error)
18634 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18643 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18644 __Pyx_GOTREF(__pyx_t_23);
18645 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18646 __Pyx_GOTREF(__pyx_t_20);
18647 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18648 __Pyx_GOTREF(__pyx_t_21);
18649 __pyx_t_22 = PyTuple_New(4);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 851, __pyx_L1_error)
18650 __Pyx_GOTREF(__pyx_t_22);
18651 __Pyx_GIVEREF(__pyx_t_23);
18652 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_23);
18653 __Pyx_GIVEREF(__pyx_t_20);
18654 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
18655 __Pyx_GIVEREF(__pyx_t_21);
18656 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21);
18657 __Pyx_INCREF(__pyx_slice_);
18658 __Pyx_GIVEREF(__pyx_slice_);
18659 PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_slice_);
18663 __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 851, __pyx_L1_error)
18664 __Pyx_GOTREF(__pyx_t_21);
18665 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
18666 __pyx_t_24 = (__pyx_v_tForReversal - 0.0);
18667 if (unlikely(__pyx_t_24 == 0)) {
18668 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18669 __PYX_ERR(0, 851, __pyx_L1_error)
18671 __pyx_t_20 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_24) * __pyx_v_clock));
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 851, __pyx_L1_error)
18672 __Pyx_GOTREF(__pyx_t_20);
18673 __pyx_t_23 = PyNumber_InPlaceMultiply(__pyx_t_21, __pyx_t_20);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 851, __pyx_L1_error)
18674 __Pyx_GOTREF(__pyx_t_23);
18675 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
18676 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
18677 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18678 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18679 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18702 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18703 __pyx_t_3 = __pyx_t_2;
18704 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18705 __pyx_v_eN = __pyx_t_4;
18714 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
18715 __pyx_t_6 = __pyx_t_5;
18716 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18717 __pyx_v_ebN = __pyx_t_7;
18726 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
18727 __pyx_t_9 = __pyx_t_8;
18728 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
18729 __pyx_v_k = __pyx_t_10;
18738 __pyx_t_11 = __pyx_v_eN;
18739 __pyx_t_12 = __pyx_v_ebN;
18740 __pyx_t_13 = __pyx_v_k;
18743 if (__pyx_t_11 < 0) {
18744 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
18745 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
18746 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18747 if (__pyx_t_12 < 0) {
18748 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
18749 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
18750 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18751 if (__pyx_t_13 < 0) {
18752 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
18753 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
18754 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18755 if (__pyx_t_14 < 0) {
18756 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
18757 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
18758 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18759 if (unlikely(__pyx_t_15 != -1)) {
18760 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18761 __PYX_ERR(0, 856, __pyx_L1_error)
18763 __pyx_t_16 = __pyx_v_eN;
18764 __pyx_t_17 = __pyx_v_ebN;
18765 __pyx_t_18 = __pyx_v_k;
18768 if (__pyx_t_16 < 0) {
18769 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18770 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
18771 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18772 if (__pyx_t_17 < 0) {
18773 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18774 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
18775 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18776 if (__pyx_t_18 < 0) {
18777 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18778 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
18779 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18780 if (__pyx_t_19 < 0) {
18781 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
18782 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
18783 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18784 if (unlikely(__pyx_t_15 != -1)) {
18785 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18786 __PYX_ERR(0, 856, __pyx_L1_error)
18788 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18797 __pyx_t_14 = __pyx_v_eN;
18798 __pyx_t_13 = __pyx_v_ebN;
18799 __pyx_t_12 = __pyx_v_k;
18802 if (__pyx_t_14 < 0) {
18803 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
18804 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
18805 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
18806 if (__pyx_t_13 < 0) {
18807 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
18808 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
18809 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
18810 if (__pyx_t_12 < 0) {
18811 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
18812 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
18813 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
18814 if (__pyx_t_11 < 0) {
18815 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18816 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
18817 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
18818 if (unlikely(__pyx_t_15 != -1)) {
18819 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18820 __PYX_ERR(0, 857, __pyx_L1_error)
18822 __pyx_t_19 = __pyx_v_eN;
18823 __pyx_t_18 = __pyx_v_ebN;
18824 __pyx_t_17 = __pyx_v_k;
18827 if (__pyx_t_19 < 0) {
18828 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18829 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
18830 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
18831 if (__pyx_t_18 < 0) {
18832 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
18833 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
18834 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
18835 if (__pyx_t_17 < 0) {
18836 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
18837 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
18838 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
18839 if (__pyx_t_16 < 0) {
18840 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18841 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
18842 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
18843 if (unlikely(__pyx_t_15 != -1)) {
18844 __Pyx_RaiseBufferIndexError(__pyx_t_15);
18845 __PYX_ERR(0, 857, __pyx_L1_error)
18847 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
18865 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18868 __Pyx_XDECREF(__pyx_t_20);
18869 __Pyx_XDECREF(__pyx_t_21);
18870 __Pyx_XDECREF(__pyx_t_22);
18871 __Pyx_XDECREF(__pyx_t_23);
18872 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18873 __Pyx_PyThreadState_declare
18874 __Pyx_PyThreadState_assign
18875 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18876 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18877 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18878 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18879 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18883 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18884 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18886 __Pyx_XGIVEREF(__pyx_r);
18887 __Pyx_RefNannyFinishContext();
18900 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18901 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
18902 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18903 int __pyx_v_transient;
18905 double __pyx_v_tForReversal;
18906 double __pyx_v_clock;
18907 double __pyx_v_zVelocity;
18910 PyArrayObject *__pyx_v_x = 0;
18911 PyArrayObject *__pyx_v_v = 0;
18912 int __pyx_lineno = 0;
18913 const char *__pyx_filename = NULL;
18914 int __pyx_clineno = 0;
18915 PyObject *__pyx_r = 0;
18916 __Pyx_RefNannyDeclarations
18917 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
18919 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
18920 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
18921 if (unlikely(__pyx_kwds)) {
18922 Py_ssize_t kw_args;
18923 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18924 switch (pos_args) {
18925 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18926 CYTHON_FALLTHROUGH;
18927 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18928 CYTHON_FALLTHROUGH;
18929 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18930 CYTHON_FALLTHROUGH;
18931 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18932 CYTHON_FALLTHROUGH;
18933 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18934 CYTHON_FALLTHROUGH;
18935 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18936 CYTHON_FALLTHROUGH;
18937 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18938 CYTHON_FALLTHROUGH;
18939 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18940 CYTHON_FALLTHROUGH;
18941 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18942 CYTHON_FALLTHROUGH;
18944 default:
goto __pyx_L5_argtuple_error;
18946 kw_args = PyDict_Size(__pyx_kwds);
18947 switch (pos_args) {
18949 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
18950 else goto __pyx_L5_argtuple_error;
18951 CYTHON_FALLTHROUGH;
18953 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18955 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
18957 CYTHON_FALLTHROUGH;
18959 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
18961 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
18963 CYTHON_FALLTHROUGH;
18965 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
18967 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
18969 CYTHON_FALLTHROUGH;
18971 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
18973 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
18975 CYTHON_FALLTHROUGH;
18977 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
18979 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
18981 CYTHON_FALLTHROUGH;
18983 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
18985 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
18987 CYTHON_FALLTHROUGH;
18989 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18991 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
18993 CYTHON_FALLTHROUGH;
18995 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
18997 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
19000 if (unlikely(kw_args > 0)) {
19001 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
19003 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19004 goto __pyx_L5_argtuple_error;
19006 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19007 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19008 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19009 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19010 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19011 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19012 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19013 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19014 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19016 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
19017 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
19018 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
19019 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
19020 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
19021 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19022 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
19023 __pyx_v_x = ((PyArrayObject *)values[7]);
19024 __pyx_v_v = ((PyArrayObject *)values[8]);
19026 goto __pyx_L4_argument_unpacking_done;
19027 __pyx_L5_argtuple_error:;
19028 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
19030 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19031 __Pyx_RefNannyFinishContext();
19033 __pyx_L4_argument_unpacking_done:;
19034 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
19035 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
19036 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19043 __Pyx_RefNannyFinishContext();
19047 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19051 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19052 __Pyx_Buffer __pyx_pybuffer_v;
19053 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19054 __Pyx_Buffer __pyx_pybuffer_x;
19055 PyObject *__pyx_r = NULL;
19056 __Pyx_RefNannyDeclarations
19058 npy_intp __pyx_t_2;
19059 npy_intp __pyx_t_3;
19061 npy_intp __pyx_t_5;
19062 npy_intp __pyx_t_6;
19064 Py_ssize_t __pyx_t_8;
19065 Py_ssize_t __pyx_t_9;
19066 Py_ssize_t __pyx_t_10;
19068 Py_ssize_t __pyx_t_12;
19069 Py_ssize_t __pyx_t_13;
19070 Py_ssize_t __pyx_t_14;
19071 PyObject *__pyx_t_15 = NULL;
19072 PyObject *__pyx_t_16 = NULL;
19073 PyObject *__pyx_t_17 = NULL;
19076 PyObject *__pyx_t_20 = NULL;
19077 int __pyx_lineno = 0;
19078 const char *__pyx_filename = NULL;
19079 int __pyx_clineno = 0;
19080 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
19081 __pyx_pybuffer_x.pybuffer.buf = NULL;
19082 __pyx_pybuffer_x.refcount = 0;
19083 __pyx_pybuffernd_x.data = NULL;
19084 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19085 __pyx_pybuffer_v.pybuffer.buf = NULL;
19086 __pyx_pybuffer_v.refcount = 0;
19087 __pyx_pybuffernd_v.data = NULL;
19088 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19090 __Pyx_BufFmt_StackElem __pyx_stack[1];
19091 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19093 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19095 __Pyx_BufFmt_StackElem __pyx_stack[1];
19096 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
19098 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19116 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19126 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19127 __pyx_t_3 = __pyx_t_2;
19128 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19129 __pyx_v_eN = __pyx_t_4;
19138 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19139 __pyx_t_6 = __pyx_t_5;
19140 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19141 __pyx_v_k = __pyx_t_7;
19150 __pyx_t_8 = __pyx_v_eN;
19151 __pyx_t_9 = __pyx_v_k;
19154 if (__pyx_t_8 < 0) {
19155 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19156 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19157 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19158 if (__pyx_t_9 < 0) {
19159 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19160 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19161 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19162 if (__pyx_t_10 < 0) {
19163 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19164 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19165 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19166 if (unlikely(__pyx_t_11 != -1)) {
19167 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19168 __PYX_ERR(0, 873, __pyx_L1_error)
19170 __pyx_t_12 = __pyx_v_eN;
19171 __pyx_t_13 = __pyx_v_k;
19174 if (__pyx_t_12 < 0) {
19175 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19176 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19177 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19178 if (__pyx_t_13 < 0) {
19179 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19180 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19181 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19182 if (__pyx_t_14 < 0) {
19183 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19184 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19185 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19186 if (unlikely(__pyx_t_11 != -1)) {
19187 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19188 __PYX_ERR(0, 873, __pyx_L1_error)
19190 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19199 __pyx_t_10 = __pyx_v_eN;
19200 __pyx_t_9 = __pyx_v_k;
19203 if (__pyx_t_10 < 0) {
19204 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19205 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19206 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19207 if (__pyx_t_9 < 0) {
19208 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19209 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19210 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19211 if (__pyx_t_8 < 0) {
19212 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19213 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19214 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19215 if (unlikely(__pyx_t_11 != -1)) {
19216 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19217 __PYX_ERR(0, 874, __pyx_L1_error)
19219 __pyx_t_14 = __pyx_v_eN;
19220 __pyx_t_13 = __pyx_v_k;
19223 if (__pyx_t_14 < 0) {
19224 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19225 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19226 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19227 if (__pyx_t_13 < 0) {
19228 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19229 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19230 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19231 if (__pyx_t_12 < 0) {
19232 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19233 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19234 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19235 if (unlikely(__pyx_t_11 != -1)) {
19236 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19237 __PYX_ERR(0, 874, __pyx_L1_error)
19239 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides))));
19248 __pyx_t_8 = __pyx_v_eN;
19249 __pyx_t_9 = __pyx_v_k;
19252 if (__pyx_t_8 < 0) {
19253 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[0].shape;
19254 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19255 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19256 if (__pyx_t_9 < 0) {
19257 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19258 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19259 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19260 if (__pyx_t_10 < 0) {
19261 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[2].shape;
19262 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19263 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19264 if (unlikely(__pyx_t_11 != -1)) {
19265 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19266 __PYX_ERR(0, 875, __pyx_L1_error)
19268 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19277 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19278 __Pyx_GOTREF(__pyx_t_15);
19279 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19280 __Pyx_GOTREF(__pyx_t_16);
19281 __pyx_t_17 = PyTuple_New(3);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
19282 __Pyx_GOTREF(__pyx_t_17);
19283 __Pyx_GIVEREF(__pyx_t_15);
19284 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
19285 __Pyx_GIVEREF(__pyx_t_16);
19286 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
19287 __Pyx_INCREF(__pyx_slice_);
19288 __Pyx_GIVEREF(__pyx_slice_);
19289 PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_slice_);
19292 __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 876, __pyx_L1_error)
19293 __Pyx_GOTREF(__pyx_t_16);
19294 __pyx_t_18 = (__pyx_v_pi * __pyx_v_t);
19295 __pyx_t_19 = (__pyx_v_tForReversal * 2.0);
19296 if (unlikely(__pyx_t_19 == 0)) {
19297 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19298 __PYX_ERR(0, 876, __pyx_L1_error)
19300 __pyx_t_15 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_18 / __pyx_t_19))));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 876, __pyx_L1_error)
19301 __Pyx_GOTREF(__pyx_t_15);
19302 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 876, __pyx_L1_error)
19303 __Pyx_GOTREF(__pyx_t_20);
19304 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19305 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19306 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_17, __pyx_t_20) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
19307 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19308 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
19330 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19331 __pyx_t_3 = __pyx_t_2;
19332 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19333 __pyx_v_eN = __pyx_t_4;
19342 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19343 __pyx_t_6 = __pyx_t_5;
19344 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19345 __pyx_v_k = __pyx_t_7;
19354 __pyx_t_10 = __pyx_v_eN;
19355 __pyx_t_9 = __pyx_v_k;
19358 if (__pyx_t_10 < 0) {
19359 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
19360 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19361 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19362 if (__pyx_t_9 < 0) {
19363 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19364 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19365 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19366 if (__pyx_t_8 < 0) {
19367 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
19368 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19369 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19370 if (unlikely(__pyx_t_11 != -1)) {
19371 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19372 __PYX_ERR(0, 880, __pyx_L1_error)
19374 __pyx_t_12 = __pyx_v_eN;
19375 __pyx_t_13 = __pyx_v_k;
19378 if (__pyx_t_12 < 0) {
19379 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[0].shape;
19380 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19381 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19382 if (__pyx_t_13 < 0) {
19383 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19384 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19385 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19386 if (__pyx_t_14 < 0) {
19387 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[2].shape;
19388 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19389 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19390 if (unlikely(__pyx_t_11 != -1)) {
19391 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19392 __PYX_ERR(0, 880, __pyx_L1_error)
19394 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
19403 __pyx_t_8 = __pyx_v_eN;
19404 __pyx_t_9 = __pyx_v_k;
19407 if (__pyx_t_8 < 0) {
19408 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19409 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 0;
19410 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19411 if (__pyx_t_9 < 0) {
19412 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19413 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19414 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19415 if (__pyx_t_10 < 0) {
19416 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19417 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 2;
19418 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19419 if (unlikely(__pyx_t_11 != -1)) {
19420 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19421 __PYX_ERR(0, 881, __pyx_L1_error)
19423 __pyx_t_14 = __pyx_v_eN;
19424 __pyx_t_13 = __pyx_v_k;
19427 if (__pyx_t_14 < 0) {
19428 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
19429 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
19430 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19431 if (__pyx_t_13 < 0) {
19432 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
19433 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19434 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19435 if (__pyx_t_12 < 0) {
19436 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
19437 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 2;
19438 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19439 if (unlikely(__pyx_t_11 != -1)) {
19440 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19441 __PYX_ERR(0, 881, __pyx_L1_error)
19443 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides))));
19452 __pyx_t_10 = __pyx_v_eN;
19453 __pyx_t_9 = __pyx_v_k;
19456 if (__pyx_t_10 < 0) {
19457 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
19458 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
19459 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19460 if (__pyx_t_9 < 0) {
19461 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[1].shape;
19462 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 1;
19463 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19464 if (__pyx_t_8 < 0) {
19465 __pyx_t_8 += __pyx_pybuffernd_v.diminfo[2].shape;
19466 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 2;
19467 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19468 if (unlikely(__pyx_t_11 != -1)) {
19469 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19470 __PYX_ERR(0, 882, __pyx_L1_error)
19472 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
19487 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19490 __Pyx_XDECREF(__pyx_t_15);
19491 __Pyx_XDECREF(__pyx_t_16);
19492 __Pyx_XDECREF(__pyx_t_17);
19493 __Pyx_XDECREF(__pyx_t_20);
19494 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19495 __Pyx_PyThreadState_declare
19496 __Pyx_PyThreadState_assign
19497 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19498 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19499 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19500 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19501 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19505 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19506 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19508 __Pyx_XGIVEREF(__pyx_r);
19509 __Pyx_RefNannyFinishContext();
19522 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19523 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19524 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19525 int __pyx_v_transient;
19527 double __pyx_v_tForReversal;
19528 double __pyx_v_clock;
19529 double __pyx_v_zVelocity;
19532 PyArrayObject *__pyx_v_x = 0;
19533 PyArrayObject *__pyx_v_v = 0;
19534 int __pyx_lineno = 0;
19535 const char *__pyx_filename = NULL;
19536 int __pyx_clineno = 0;
19537 PyObject *__pyx_r = 0;
19538 __Pyx_RefNannyDeclarations
19539 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19541 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19542 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19543 if (unlikely(__pyx_kwds)) {
19544 Py_ssize_t kw_args;
19545 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19546 switch (pos_args) {
19547 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19548 CYTHON_FALLTHROUGH;
19549 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19550 CYTHON_FALLTHROUGH;
19551 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19552 CYTHON_FALLTHROUGH;
19553 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19554 CYTHON_FALLTHROUGH;
19555 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19556 CYTHON_FALLTHROUGH;
19557 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19558 CYTHON_FALLTHROUGH;
19559 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19560 CYTHON_FALLTHROUGH;
19561 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19562 CYTHON_FALLTHROUGH;
19563 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19564 CYTHON_FALLTHROUGH;
19566 default:
goto __pyx_L5_argtuple_error;
19568 kw_args = PyDict_Size(__pyx_kwds);
19569 switch (pos_args) {
19571 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19572 else goto __pyx_L5_argtuple_error;
19573 CYTHON_FALLTHROUGH;
19575 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19577 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19579 CYTHON_FALLTHROUGH;
19581 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19583 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19585 CYTHON_FALLTHROUGH;
19587 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19589 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19591 CYTHON_FALLTHROUGH;
19593 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19595 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19597 CYTHON_FALLTHROUGH;
19599 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19601 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19603 CYTHON_FALLTHROUGH;
19605 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19607 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19609 CYTHON_FALLTHROUGH;
19611 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19613 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19615 CYTHON_FALLTHROUGH;
19617 if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19619 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19622 if (unlikely(kw_args > 0)) {
19623 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19625 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19626 goto __pyx_L5_argtuple_error;
19628 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19629 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19630 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19631 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19632 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19633 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19634 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19635 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19636 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19638 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19639 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19640 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19641 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19642 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19643 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19644 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19645 __pyx_v_x = ((PyArrayObject *)values[7]);
19646 __pyx_v_v = ((PyArrayObject *)values[8]);
19648 goto __pyx_L4_argument_unpacking_done;
19649 __pyx_L5_argtuple_error:;
19650 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19652 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19653 __Pyx_RefNannyFinishContext();
19655 __pyx_L4_argument_unpacking_done:;
19656 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19657 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19658 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19665 __Pyx_RefNannyFinishContext();
19669 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19674 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19675 __Pyx_Buffer __pyx_pybuffer_v;
19676 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19677 __Pyx_Buffer __pyx_pybuffer_x;
19678 PyObject *__pyx_r = NULL;
19679 __Pyx_RefNannyDeclarations
19681 npy_intp __pyx_t_2;
19682 npy_intp __pyx_t_3;
19684 npy_intp __pyx_t_5;
19685 npy_intp __pyx_t_6;
19687 npy_intp __pyx_t_8;
19688 npy_intp __pyx_t_9;
19690 Py_ssize_t __pyx_t_11;
19691 Py_ssize_t __pyx_t_12;
19692 Py_ssize_t __pyx_t_13;
19693 Py_ssize_t __pyx_t_14;
19695 Py_ssize_t __pyx_t_16;
19696 Py_ssize_t __pyx_t_17;
19697 Py_ssize_t __pyx_t_18;
19698 Py_ssize_t __pyx_t_19;
19699 PyObject *__pyx_t_20 = NULL;
19700 PyObject *__pyx_t_21 = NULL;
19701 PyObject *__pyx_t_22 = NULL;
19702 PyObject *__pyx_t_23 = NULL;
19705 int __pyx_lineno = 0;
19706 const char *__pyx_filename = NULL;
19707 int __pyx_clineno = 0;
19708 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19709 __pyx_pybuffer_x.pybuffer.buf = NULL;
19710 __pyx_pybuffer_x.refcount = 0;
19711 __pyx_pybuffernd_x.data = NULL;
19712 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19713 __pyx_pybuffer_v.pybuffer.buf = NULL;
19714 __pyx_pybuffer_v.refcount = 0;
19715 __pyx_pybuffernd_v.data = NULL;
19716 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19718 __Pyx_BufFmt_StackElem __pyx_stack[1];
19719 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19721 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19723 __Pyx_BufFmt_StackElem __pyx_stack[1];
19724 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19726 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19744 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19754 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19755 __pyx_t_3 = __pyx_t_2;
19756 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19757 __pyx_v_eN = __pyx_t_4;
19766 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
19767 __pyx_t_6 = __pyx_t_5;
19768 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19769 __pyx_v_ebN = __pyx_t_7;
19778 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
19779 __pyx_t_9 = __pyx_t_8;
19780 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
19781 __pyx_v_k = __pyx_t_10;
19790 __pyx_t_11 = __pyx_v_eN;
19791 __pyx_t_12 = __pyx_v_ebN;
19792 __pyx_t_13 = __pyx_v_k;
19795 if (__pyx_t_11 < 0) {
19796 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
19797 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19798 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19799 if (__pyx_t_12 < 0) {
19800 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
19801 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19802 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19803 if (__pyx_t_13 < 0) {
19804 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
19805 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
19806 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19807 if (__pyx_t_14 < 0) {
19808 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
19809 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
19810 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19811 if (unlikely(__pyx_t_15 != -1)) {
19812 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19813 __PYX_ERR(0, 899, __pyx_L1_error)
19815 __pyx_t_16 = __pyx_v_eN;
19816 __pyx_t_17 = __pyx_v_ebN;
19817 __pyx_t_18 = __pyx_v_k;
19820 if (__pyx_t_16 < 0) {
19821 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
19822 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
19823 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19824 if (__pyx_t_17 < 0) {
19825 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
19826 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
19827 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19828 if (__pyx_t_18 < 0) {
19829 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
19830 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
19831 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19832 if (__pyx_t_19 < 0) {
19833 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
19834 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
19835 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19836 if (unlikely(__pyx_t_15 != -1)) {
19837 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19838 __PYX_ERR(0, 899, __pyx_L1_error)
19840 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
19849 __pyx_t_14 = __pyx_v_eN;
19850 __pyx_t_13 = __pyx_v_ebN;
19851 __pyx_t_12 = __pyx_v_k;
19854 if (__pyx_t_14 < 0) {
19855 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
19856 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
19857 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
19858 if (__pyx_t_13 < 0) {
19859 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19860 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
19861 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
19862 if (__pyx_t_12 < 0) {
19863 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
19864 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
19865 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
19866 if (__pyx_t_11 < 0) {
19867 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
19868 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
19869 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
19870 if (unlikely(__pyx_t_15 != -1)) {
19871 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19872 __PYX_ERR(0, 900, __pyx_L1_error)
19874 __pyx_t_19 = __pyx_v_eN;
19875 __pyx_t_18 = __pyx_v_ebN;
19876 __pyx_t_17 = __pyx_v_k;
19879 if (__pyx_t_19 < 0) {
19880 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
19881 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
19882 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19883 if (__pyx_t_18 < 0) {
19884 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
19885 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
19886 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19887 if (__pyx_t_17 < 0) {
19888 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
19889 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
19890 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19891 if (__pyx_t_16 < 0) {
19892 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
19893 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
19894 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19895 if (unlikely(__pyx_t_15 != -1)) {
19896 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19897 __PYX_ERR(0, 900, __pyx_L1_error)
19899 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides))));
19908 __pyx_t_11 = __pyx_v_eN;
19909 __pyx_t_12 = __pyx_v_ebN;
19910 __pyx_t_13 = __pyx_v_k;
19913 if (__pyx_t_11 < 0) {
19914 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[0].shape;
19915 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
19916 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
19917 if (__pyx_t_12 < 0) {
19918 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[1].shape;
19919 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
19920 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
19921 if (__pyx_t_13 < 0) {
19922 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[2].shape;
19923 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
19924 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
19925 if (__pyx_t_14 < 0) {
19926 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[3].shape;
19927 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
19928 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
19929 if (unlikely(__pyx_t_15 != -1)) {
19930 __Pyx_RaiseBufferIndexError(__pyx_t_15);
19931 __PYX_ERR(0, 901, __pyx_L1_error)
19933 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
19942 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
19943 __Pyx_GOTREF(__pyx_t_20);
19944 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
19945 __Pyx_GOTREF(__pyx_t_21);
19946 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
19947 __Pyx_GOTREF(__pyx_t_22);
19948 __pyx_t_23 = PyTuple_New(4);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 902, __pyx_L1_error)
19949 __Pyx_GOTREF(__pyx_t_23);
19950 __Pyx_GIVEREF(__pyx_t_20);
19951 PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20);
19952 __Pyx_GIVEREF(__pyx_t_21);
19953 PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_21);
19954 __Pyx_GIVEREF(__pyx_t_22);
19955 PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_22);
19956 __Pyx_INCREF(__pyx_slice_);
19957 __Pyx_GIVEREF(__pyx_slice_);
19958 PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_slice_);
19962 __pyx_t_22 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_23);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 902, __pyx_L1_error)
19963 __Pyx_GOTREF(__pyx_t_22);
19964 __pyx_t_24 = (__pyx_v_pi * __pyx_v_t);
19965 __pyx_t_25 = (__pyx_v_tForReversal * 2.0);
19966 if (unlikely(__pyx_t_25 == 0)) {
19967 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19968 __PYX_ERR(0, 902, __pyx_L1_error)
19970 __pyx_t_21 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_24 / __pyx_t_25))));
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 902, __pyx_L1_error)
19971 __Pyx_GOTREF(__pyx_t_21);
19972 __pyx_t_20 = PyNumber_InPlaceMultiply(__pyx_t_22, __pyx_t_21);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
19973 __Pyx_GOTREF(__pyx_t_20);
19974 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
19975 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
19976 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_23, __pyx_t_20) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
19977 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19978 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
20001 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
20002 __pyx_t_3 = __pyx_t_2;
20003 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20004 __pyx_v_eN = __pyx_t_4;
20013 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
20014 __pyx_t_6 = __pyx_t_5;
20015 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
20016 __pyx_v_ebN = __pyx_t_7;
20025 __pyx_t_8 = (__pyx_v_x->dimensions[2]);
20026 __pyx_t_9 = __pyx_t_8;
20027 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
20028 __pyx_v_k = __pyx_t_10;
20037 __pyx_t_14 = __pyx_v_eN;
20038 __pyx_t_13 = __pyx_v_ebN;
20039 __pyx_t_12 = __pyx_v_k;
20042 if (__pyx_t_14 < 0) {
20043 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20044 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20045 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20046 if (__pyx_t_13 < 0) {
20047 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
20048 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20049 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20050 if (__pyx_t_12 < 0) {
20051 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20052 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20053 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20054 if (__pyx_t_11 < 0) {
20055 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
20056 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20057 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20058 if (unlikely(__pyx_t_15 != -1)) {
20059 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20060 __PYX_ERR(0, 907, __pyx_L1_error)
20062 __pyx_t_16 = __pyx_v_eN;
20063 __pyx_t_17 = __pyx_v_ebN;
20064 __pyx_t_18 = __pyx_v_k;
20067 if (__pyx_t_16 < 0) {
20068 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
20069 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
20070 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20071 if (__pyx_t_17 < 0) {
20072 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
20073 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 1;
20074 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20075 if (__pyx_t_18 < 0) {
20076 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
20077 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 2;
20078 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20079 if (__pyx_t_19 < 0) {
20080 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[3].shape;
20081 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 3;
20082 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20083 if (unlikely(__pyx_t_15 != -1)) {
20084 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20085 __PYX_ERR(0, 907, __pyx_L1_error)
20087 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
20096 __pyx_t_11 = __pyx_v_eN;
20097 __pyx_t_12 = __pyx_v_ebN;
20098 __pyx_t_13 = __pyx_v_k;
20101 if (__pyx_t_11 < 0) {
20102 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20103 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 0;
20104 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_15 = 0;
20105 if (__pyx_t_12 < 0) {
20106 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20107 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 1;
20108 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_15 = 1;
20109 if (__pyx_t_13 < 0) {
20110 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20111 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 2;
20112 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_15 = 2;
20113 if (__pyx_t_14 < 0) {
20114 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[3].shape;
20115 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 3;
20116 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_15 = 3;
20117 if (unlikely(__pyx_t_15 != -1)) {
20118 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20119 __PYX_ERR(0, 908, __pyx_L1_error)
20121 __pyx_t_19 = __pyx_v_eN;
20122 __pyx_t_18 = __pyx_v_ebN;
20123 __pyx_t_17 = __pyx_v_k;
20126 if (__pyx_t_19 < 0) {
20127 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20128 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
20129 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20130 if (__pyx_t_18 < 0) {
20131 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20132 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
20133 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20134 if (__pyx_t_17 < 0) {
20135 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20136 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 2;
20137 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20138 if (__pyx_t_16 < 0) {
20139 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
20140 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 3;
20141 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20142 if (unlikely(__pyx_t_15 != -1)) {
20143 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20144 __PYX_ERR(0, 908, __pyx_L1_error)
20146 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[3].strides))));
20155 __pyx_t_14 = __pyx_v_eN;
20156 __pyx_t_13 = __pyx_v_ebN;
20157 __pyx_t_12 = __pyx_v_k;
20160 if (__pyx_t_14 < 0) {
20161 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[0].shape;
20162 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
20163 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_15 = 0;
20164 if (__pyx_t_13 < 0) {
20165 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[1].shape;
20166 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 1;
20167 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_15 = 1;
20168 if (__pyx_t_12 < 0) {
20169 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
20170 if (unlikely(__pyx_t_12 < 0)) __pyx_t_15 = 2;
20171 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_15 = 2;
20172 if (__pyx_t_11 < 0) {
20173 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[3].shape;
20174 if (unlikely(__pyx_t_11 < 0)) __pyx_t_15 = 3;
20175 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_15 = 3;
20176 if (unlikely(__pyx_t_15 != -1)) {
20177 __Pyx_RaiseBufferIndexError(__pyx_t_15);
20178 __PYX_ERR(0, 909, __pyx_L1_error)
20180 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
20196 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20199 __Pyx_XDECREF(__pyx_t_20);
20200 __Pyx_XDECREF(__pyx_t_21);
20201 __Pyx_XDECREF(__pyx_t_22);
20202 __Pyx_XDECREF(__pyx_t_23);
20203 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20204 __Pyx_PyThreadState_declare
20205 __Pyx_PyThreadState_assign
20206 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20207 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20208 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20209 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20210 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20214 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20215 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20217 __Pyx_XGIVEREF(__pyx_r);
20218 __Pyx_RefNannyFinishContext();
20231 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20232 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
20233 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20235 PyArrayObject *__pyx_v_x = 0;
20236 PyArrayObject *__pyx_v_v = 0;
20237 int __pyx_lineno = 0;
20238 const char *__pyx_filename = NULL;
20239 int __pyx_clineno = 0;
20240 PyObject *__pyx_r = 0;
20241 __Pyx_RefNannyDeclarations
20242 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
20244 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20245 PyObject* values[3] = {0,0,0};
20246 if (unlikely(__pyx_kwds)) {
20247 Py_ssize_t kw_args;
20248 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20249 switch (pos_args) {
20250 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20251 CYTHON_FALLTHROUGH;
20252 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20253 CYTHON_FALLTHROUGH;
20254 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20255 CYTHON_FALLTHROUGH;
20257 default:
goto __pyx_L5_argtuple_error;
20259 kw_args = PyDict_Size(__pyx_kwds);
20260 switch (pos_args) {
20262 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20263 else goto __pyx_L5_argtuple_error;
20264 CYTHON_FALLTHROUGH;
20266 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20268 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
20270 CYTHON_FALLTHROUGH;
20272 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20274 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
20277 if (unlikely(kw_args > 0)) {
20278 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
20280 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20281 goto __pyx_L5_argtuple_error;
20283 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20284 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20285 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20287 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
20288 __pyx_v_x = ((PyArrayObject *)values[1]);
20289 __pyx_v_v = ((PyArrayObject *)values[2]);
20291 goto __pyx_L4_argument_unpacking_done;
20292 __pyx_L5_argtuple_error:;
20293 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
20295 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20296 __Pyx_RefNannyFinishContext();
20298 __pyx_L4_argument_unpacking_done:;
20299 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
20300 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
20301 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20308 __Pyx_RefNannyFinishContext();
20312 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20316 double __pyx_v_one8;
20317 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20318 __Pyx_Buffer __pyx_pybuffer_v;
20319 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20320 __Pyx_Buffer __pyx_pybuffer_x;
20321 PyObject *__pyx_r = NULL;
20322 __Pyx_RefNannyDeclarations
20323 npy_intp __pyx_t_1;
20324 npy_intp __pyx_t_2;
20326 npy_intp __pyx_t_4;
20327 npy_intp __pyx_t_5;
20329 Py_ssize_t __pyx_t_7;
20330 Py_ssize_t __pyx_t_8;
20331 Py_ssize_t __pyx_t_9;
20333 Py_ssize_t __pyx_t_11;
20334 Py_ssize_t __pyx_t_12;
20335 Py_ssize_t __pyx_t_13;
20336 Py_ssize_t __pyx_t_14;
20337 Py_ssize_t __pyx_t_15;
20338 Py_ssize_t __pyx_t_16;
20339 Py_ssize_t __pyx_t_17;
20340 Py_ssize_t __pyx_t_18;
20341 Py_ssize_t __pyx_t_19;
20342 int __pyx_lineno = 0;
20343 const char *__pyx_filename = NULL;
20344 int __pyx_clineno = 0;
20345 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
20346 __pyx_pybuffer_x.pybuffer.buf = NULL;
20347 __pyx_pybuffer_x.refcount = 0;
20348 __pyx_pybuffernd_x.data = NULL;
20349 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20350 __pyx_pybuffer_v.pybuffer.buf = NULL;
20351 __pyx_pybuffer_v.refcount = 0;
20352 __pyx_pybuffernd_v.data = NULL;
20353 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20355 __Pyx_BufFmt_StackElem __pyx_stack[1];
20356 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20358 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
20360 __Pyx_BufFmt_StackElem __pyx_stack[1];
20361 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
20363 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
20381 __pyx_v_one8 = (1.0 / 8.0);
20390 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20391 __pyx_t_2 = __pyx_t_1;
20392 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20393 __pyx_v_eN = __pyx_t_3;
20402 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20403 __pyx_t_5 = __pyx_t_4;
20404 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20405 __pyx_v_k = __pyx_t_6;
20414 __pyx_t_7 = __pyx_v_eN;
20415 __pyx_t_8 = __pyx_v_k;
20418 if (__pyx_t_7 < 0) {
20419 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20420 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 0;
20421 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20422 if (__pyx_t_8 < 0) {
20423 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20424 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20425 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20426 if (__pyx_t_9 < 0) {
20427 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20428 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 2;
20429 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20430 if (unlikely(__pyx_t_10 != -1)) {
20431 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20432 __PYX_ERR(0, 920, __pyx_L1_error)
20434 __pyx_t_11 = __pyx_v_eN;
20435 __pyx_t_12 = __pyx_v_k;
20438 if (__pyx_t_11 < 0) {
20439 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[0].shape;
20440 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 0;
20441 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20442 if (__pyx_t_12 < 0) {
20443 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20444 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20445 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20446 if (__pyx_t_13 < 0) {
20447 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[2].shape;
20448 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 2;
20449 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20450 if (unlikely(__pyx_t_10 != -1)) {
20451 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20452 __PYX_ERR(0, 920, __pyx_L1_error)
20454 __pyx_t_14 = __pyx_v_eN;
20455 __pyx_t_15 = __pyx_v_k;
20458 if (__pyx_t_14 < 0) {
20459 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[0].shape;
20460 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
20461 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20462 if (__pyx_t_15 < 0) {
20463 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20464 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20465 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20466 if (__pyx_t_16 < 0) {
20467 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20468 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 2;
20469 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20470 if (unlikely(__pyx_t_10 != -1)) {
20471 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20472 __PYX_ERR(0, 920, __pyx_L1_error)
20474 __pyx_t_17 = __pyx_v_eN;
20475 __pyx_t_18 = __pyx_v_k;
20478 if (__pyx_t_17 < 0) {
20479 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[0].shape;
20480 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
20481 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20482 if (__pyx_t_18 < 0) {
20483 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20484 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20485 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20486 if (__pyx_t_19 < 0) {
20487 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[2].shape;
20488 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 2;
20489 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20490 if (unlikely(__pyx_t_10 != -1)) {
20491 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20492 __PYX_ERR(0, 920, __pyx_L1_error)
20494 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides)))));
20503 __pyx_t_16 = __pyx_v_eN;
20504 __pyx_t_15 = __pyx_v_k;
20507 if (__pyx_t_16 < 0) {
20508 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
20509 if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
20510 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20511 if (__pyx_t_15 < 0) {
20512 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[1].shape;
20513 if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 1;
20514 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20515 if (__pyx_t_14 < 0) {
20516 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
20517 if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 2;
20518 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20519 if (unlikely(__pyx_t_10 != -1)) {
20520 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20521 __PYX_ERR(0, 921, __pyx_L1_error)
20523 __pyx_t_13 = __pyx_v_eN;
20524 __pyx_t_12 = __pyx_v_k;
20527 if (__pyx_t_13 < 0) {
20528 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
20529 if (unlikely(__pyx_t_13 < 0)) __pyx_t_10 = 0;
20530 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20531 if (__pyx_t_12 < 0) {
20532 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
20533 if (unlikely(__pyx_t_12 < 0)) __pyx_t_10 = 1;
20534 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20535 if (__pyx_t_11 < 0) {
20536 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
20537 if (unlikely(__pyx_t_11 < 0)) __pyx_t_10 = 2;
20538 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20539 if (unlikely(__pyx_t_10 != -1)) {
20540 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20541 __PYX_ERR(0, 921, __pyx_L1_error)
20543 __pyx_t_9 = __pyx_v_eN;
20544 __pyx_t_8 = __pyx_v_k;
20547 if (__pyx_t_9 < 0) {
20548 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
20549 if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
20550 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_10 = 0;
20551 if (__pyx_t_8 < 0) {
20552 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20553 if (unlikely(__pyx_t_8 < 0)) __pyx_t_10 = 1;
20554 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_10 = 1;
20555 if (__pyx_t_7 < 0) {
20556 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
20557 if (unlikely(__pyx_t_7 < 0)) __pyx_t_10 = 2;
20558 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_10 = 2;
20559 if (unlikely(__pyx_t_10 != -1)) {
20560 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20561 __PYX_ERR(0, 921, __pyx_L1_error)
20563 __pyx_t_19 = __pyx_v_eN;
20564 __pyx_t_18 = __pyx_v_k;
20567 if (__pyx_t_19 < 0) {
20568 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
20569 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
20570 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_10 = 0;
20571 if (__pyx_t_18 < 0) {
20572 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[1].shape;
20573 if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 1;
20574 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_10 = 1;
20575 if (__pyx_t_17 < 0) {
20576 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
20577 if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 2;
20578 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_10 = 2;
20579 if (unlikely(__pyx_t_10 != -1)) {
20580 __Pyx_RaiseBufferIndexError(__pyx_t_10);
20581 __PYX_ERR(0, 921, __pyx_L1_error)
20583 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides)))));
20596 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20599 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20600 __Pyx_PyThreadState_declare
20601 __Pyx_PyThreadState_assign
20602 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20603 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20604 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20605 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20606 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20610 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20611 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20613 __Pyx_XGIVEREF(__pyx_r);
20614 __Pyx_RefNannyFinishContext();
20627 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20628 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20629 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20631 PyArrayObject *__pyx_v_x = 0;
20632 PyArrayObject *__pyx_v_v = 0;
20633 int __pyx_lineno = 0;
20634 const char *__pyx_filename = NULL;
20635 int __pyx_clineno = 0;
20636 PyObject *__pyx_r = 0;
20637 __Pyx_RefNannyDeclarations
20638 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20640 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20641 PyObject* values[3] = {0,0,0};
20642 if (unlikely(__pyx_kwds)) {
20643 Py_ssize_t kw_args;
20644 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20645 switch (pos_args) {
20646 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20647 CYTHON_FALLTHROUGH;
20648 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20649 CYTHON_FALLTHROUGH;
20650 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20651 CYTHON_FALLTHROUGH;
20653 default:
goto __pyx_L5_argtuple_error;
20655 kw_args = PyDict_Size(__pyx_kwds);
20656 switch (pos_args) {
20658 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20659 else goto __pyx_L5_argtuple_error;
20660 CYTHON_FALLTHROUGH;
20662 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20664 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20666 CYTHON_FALLTHROUGH;
20668 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20670 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20673 if (unlikely(kw_args > 0)) {
20674 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20676 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20677 goto __pyx_L5_argtuple_error;
20679 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20680 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20681 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20683 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20684 __pyx_v_x = ((PyArrayObject *)values[1]);
20685 __pyx_v_v = ((PyArrayObject *)values[2]);
20687 goto __pyx_L4_argument_unpacking_done;
20688 __pyx_L5_argtuple_error:;
20689 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20691 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20692 __Pyx_RefNannyFinishContext();
20694 __pyx_L4_argument_unpacking_done:;
20695 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20696 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20697 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20704 __Pyx_RefNannyFinishContext();
20708 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20713 double __pyx_v_one8;
20714 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20715 __Pyx_Buffer __pyx_pybuffer_v;
20716 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20717 __Pyx_Buffer __pyx_pybuffer_x;
20718 PyObject *__pyx_r = NULL;
20719 __Pyx_RefNannyDeclarations
20720 npy_intp __pyx_t_1;
20721 npy_intp __pyx_t_2;
20723 npy_intp __pyx_t_4;
20724 npy_intp __pyx_t_5;
20726 npy_intp __pyx_t_7;
20727 npy_intp __pyx_t_8;
20729 Py_ssize_t __pyx_t_10;
20730 Py_ssize_t __pyx_t_11;
20731 Py_ssize_t __pyx_t_12;
20732 Py_ssize_t __pyx_t_13;
20734 Py_ssize_t __pyx_t_15;
20735 Py_ssize_t __pyx_t_16;
20736 Py_ssize_t __pyx_t_17;
20737 Py_ssize_t __pyx_t_18;
20738 Py_ssize_t __pyx_t_19;
20739 Py_ssize_t __pyx_t_20;
20740 Py_ssize_t __pyx_t_21;
20741 Py_ssize_t __pyx_t_22;
20742 Py_ssize_t __pyx_t_23;
20743 Py_ssize_t __pyx_t_24;
20744 Py_ssize_t __pyx_t_25;
20745 Py_ssize_t __pyx_t_26;
20746 int __pyx_lineno = 0;
20747 const char *__pyx_filename = NULL;
20748 int __pyx_clineno = 0;
20749 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20750 __pyx_pybuffer_x.pybuffer.buf = NULL;
20751 __pyx_pybuffer_x.refcount = 0;
20752 __pyx_pybuffernd_x.data = NULL;
20753 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20754 __pyx_pybuffer_v.pybuffer.buf = NULL;
20755 __pyx_pybuffer_v.refcount = 0;
20756 __pyx_pybuffernd_v.data = NULL;
20757 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20759 __Pyx_BufFmt_StackElem __pyx_stack[1];
20760 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20762 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
20764 __Pyx_BufFmt_StackElem __pyx_stack[1];
20765 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20767 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20785 __pyx_v_one8 = (1.0 / 8.0);
20794 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20795 __pyx_t_2 = __pyx_t_1;
20796 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20797 __pyx_v_eN = __pyx_t_3;
20806 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
20807 __pyx_t_5 = __pyx_t_4;
20808 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20809 __pyx_v_ebN = __pyx_t_6;
20818 __pyx_t_7 = (__pyx_v_x->dimensions[2]);
20819 __pyx_t_8 = __pyx_t_7;
20820 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
20821 __pyx_v_k = __pyx_t_9;
20830 __pyx_t_10 = __pyx_v_eN;
20831 __pyx_t_11 = __pyx_v_ebN;
20832 __pyx_t_12 = __pyx_v_k;
20835 if (__pyx_t_10 < 0) {
20836 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[0].shape;
20837 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 0;
20838 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20839 if (__pyx_t_11 < 0) {
20840 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[1].shape;
20841 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 1;
20842 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20843 if (__pyx_t_12 < 0) {
20844 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[2].shape;
20845 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 2;
20846 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20847 if (__pyx_t_13 < 0) {
20848 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[3].shape;
20849 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 3;
20850 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20851 if (unlikely(__pyx_t_14 != -1)) {
20852 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20853 __PYX_ERR(0, 934, __pyx_L1_error)
20855 __pyx_t_15 = __pyx_v_eN;
20856 __pyx_t_16 = __pyx_v_ebN;
20857 __pyx_t_17 = __pyx_v_k;
20860 if (__pyx_t_15 < 0) {
20861 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[0].shape;
20862 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
20863 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20864 if (__pyx_t_16 < 0) {
20865 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[1].shape;
20866 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 1;
20867 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20868 if (__pyx_t_17 < 0) {
20869 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[2].shape;
20870 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 2;
20871 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20872 if (__pyx_t_18 < 0) {
20873 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[3].shape;
20874 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 3;
20875 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20876 if (unlikely(__pyx_t_14 != -1)) {
20877 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20878 __PYX_ERR(0, 934, __pyx_L1_error)
20880 __pyx_t_19 = __pyx_v_eN;
20881 __pyx_t_20 = __pyx_v_ebN;
20882 __pyx_t_21 = __pyx_v_k;
20885 if (__pyx_t_19 < 0) {
20886 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[0].shape;
20887 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
20888 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20889 if (__pyx_t_20 < 0) {
20890 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[1].shape;
20891 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 1;
20892 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20893 if (__pyx_t_21 < 0) {
20894 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[2].shape;
20895 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 2;
20896 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20897 if (__pyx_t_22 < 0) {
20898 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[3].shape;
20899 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 3;
20900 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20901 if (unlikely(__pyx_t_14 != -1)) {
20902 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20903 __PYX_ERR(0, 934, __pyx_L1_error)
20905 __pyx_t_23 = __pyx_v_eN;
20906 __pyx_t_24 = __pyx_v_ebN;
20907 __pyx_t_25 = __pyx_v_k;
20910 if (__pyx_t_23 < 0) {
20911 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[0].shape;
20912 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 0;
20913 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
20914 if (__pyx_t_24 < 0) {
20915 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[1].shape;
20916 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 1;
20917 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
20918 if (__pyx_t_25 < 0) {
20919 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[2].shape;
20920 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 2;
20921 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
20922 if (__pyx_t_26 < 0) {
20923 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[3].shape;
20924 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 3;
20925 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
20926 if (unlikely(__pyx_t_14 != -1)) {
20927 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20928 __PYX_ERR(0, 934, __pyx_L1_error)
20930 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[3].strides)))));
20939 __pyx_t_22 = __pyx_v_eN;
20940 __pyx_t_21 = __pyx_v_ebN;
20941 __pyx_t_20 = __pyx_v_k;
20944 if (__pyx_t_22 < 0) {
20945 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[0].shape;
20946 if (unlikely(__pyx_t_22 < 0)) __pyx_t_14 = 0;
20947 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20948 if (__pyx_t_21 < 0) {
20949 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[1].shape;
20950 if (unlikely(__pyx_t_21 < 0)) __pyx_t_14 = 1;
20951 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20952 if (__pyx_t_20 < 0) {
20953 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
20954 if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 2;
20955 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20956 if (__pyx_t_19 < 0) {
20957 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
20958 if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 3;
20959 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20960 if (unlikely(__pyx_t_14 != -1)) {
20961 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20962 __PYX_ERR(0, 935, __pyx_L1_error)
20964 __pyx_t_18 = __pyx_v_eN;
20965 __pyx_t_17 = __pyx_v_ebN;
20966 __pyx_t_16 = __pyx_v_k;
20969 if (__pyx_t_18 < 0) {
20970 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
20971 if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 0;
20972 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20973 if (__pyx_t_17 < 0) {
20974 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
20975 if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 1;
20976 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
20977 if (__pyx_t_16 < 0) {
20978 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[2].shape;
20979 if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 2;
20980 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
20981 if (__pyx_t_15 < 0) {
20982 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
20983 if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 3;
20984 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
20985 if (unlikely(__pyx_t_14 != -1)) {
20986 __Pyx_RaiseBufferIndexError(__pyx_t_14);
20987 __PYX_ERR(0, 935, __pyx_L1_error)
20989 __pyx_t_13 = __pyx_v_eN;
20990 __pyx_t_12 = __pyx_v_ebN;
20991 __pyx_t_11 = __pyx_v_k;
20994 if (__pyx_t_13 < 0) {
20995 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
20996 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
20997 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_14 = 0;
20998 if (__pyx_t_12 < 0) {
20999 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[1].shape;
21000 if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 1;
21001 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_14 = 1;
21002 if (__pyx_t_11 < 0) {
21003 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
21004 if (unlikely(__pyx_t_11 < 0)) __pyx_t_14 = 2;
21005 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_14 = 2;
21006 if (__pyx_t_10 < 0) {
21007 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
21008 if (unlikely(__pyx_t_10 < 0)) __pyx_t_14 = 3;
21009 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_14 = 3;
21010 if (unlikely(__pyx_t_14 != -1)) {
21011 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21012 __PYX_ERR(0, 935, __pyx_L1_error)
21014 __pyx_t_26 = __pyx_v_eN;
21015 __pyx_t_25 = __pyx_v_ebN;
21016 __pyx_t_24 = __pyx_v_k;
21019 if (__pyx_t_26 < 0) {
21020 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[0].shape;
21021 if (unlikely(__pyx_t_26 < 0)) __pyx_t_14 = 0;
21022 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_14 = 0;
21023 if (__pyx_t_25 < 0) {
21024 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[1].shape;
21025 if (unlikely(__pyx_t_25 < 0)) __pyx_t_14 = 1;
21026 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_14 = 1;
21027 if (__pyx_t_24 < 0) {
21028 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[2].shape;
21029 if (unlikely(__pyx_t_24 < 0)) __pyx_t_14 = 2;
21030 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_14 = 2;
21031 if (__pyx_t_23 < 0) {
21032 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
21033 if (unlikely(__pyx_t_23 < 0)) __pyx_t_14 = 3;
21034 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_14 = 3;
21035 if (unlikely(__pyx_t_14 != -1)) {
21036 __Pyx_RaiseBufferIndexError(__pyx_t_14);
21037 __PYX_ERR(0, 935, __pyx_L1_error)
21039 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides)))));
21053 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21056 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
21057 __Pyx_PyThreadState_declare
21058 __Pyx_PyThreadState_assign
21059 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
21060 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21061 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21062 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
21063 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21067 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
21068 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
21070 __Pyx_XGIVEREF(__pyx_r);
21071 __Pyx_RefNannyFinishContext();
21083 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
21084 PyObject *__pyx_r = NULL;
21085 __Pyx_RefNannyDeclarations
21086 PyObject *__pyx_t_1 = NULL;
21087 int __pyx_lineno = 0;
21088 const char *__pyx_filename = NULL;
21089 int __pyx_clineno = 0;
21090 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
21099 __Pyx_XDECREF(__pyx_r);
21100 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 743, __pyx_L1_error)
21101 __Pyx_GOTREF(__pyx_t_1);
21102 __pyx_r = __pyx_t_1;
21116 __Pyx_XDECREF(__pyx_t_1);
21117 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
21120 __Pyx_XGIVEREF(__pyx_r);
21121 __Pyx_RefNannyFinishContext();
21133 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
21134 PyObject *__pyx_r = NULL;
21135 __Pyx_RefNannyDeclarations
21136 PyObject *__pyx_t_1 = NULL;
21137 int __pyx_lineno = 0;
21138 const char *__pyx_filename = NULL;
21139 int __pyx_clineno = 0;
21140 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
21149 __Pyx_XDECREF(__pyx_r);
21150 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 746, __pyx_L1_error)
21151 __Pyx_GOTREF(__pyx_t_1);
21152 __pyx_r = __pyx_t_1;
21166 __Pyx_XDECREF(__pyx_t_1);
21167 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
21170 __Pyx_XGIVEREF(__pyx_r);
21171 __Pyx_RefNannyFinishContext();
21183 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
21184 PyObject *__pyx_r = NULL;
21185 __Pyx_RefNannyDeclarations
21186 PyObject *__pyx_t_1 = NULL;
21187 int __pyx_lineno = 0;
21188 const char *__pyx_filename = NULL;
21189 int __pyx_clineno = 0;
21190 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
21199 __Pyx_XDECREF(__pyx_r);
21200 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 749, __pyx_L1_error)
21201 __Pyx_GOTREF(__pyx_t_1);
21202 __pyx_r = __pyx_t_1;
21216 __Pyx_XDECREF(__pyx_t_1);
21217 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21220 __Pyx_XGIVEREF(__pyx_r);
21221 __Pyx_RefNannyFinishContext();
21233 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
21234 PyObject *__pyx_r = NULL;
21235 __Pyx_RefNannyDeclarations
21236 PyObject *__pyx_t_1 = NULL;
21237 int __pyx_lineno = 0;
21238 const char *__pyx_filename = NULL;
21239 int __pyx_clineno = 0;
21240 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
21249 __Pyx_XDECREF(__pyx_r);
21250 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 752, __pyx_L1_error)
21251 __Pyx_GOTREF(__pyx_t_1);
21252 __pyx_r = __pyx_t_1;
21266 __Pyx_XDECREF(__pyx_t_1);
21267 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21270 __Pyx_XGIVEREF(__pyx_r);
21271 __Pyx_RefNannyFinishContext();
21283 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
21284 PyObject *__pyx_r = NULL;
21285 __Pyx_RefNannyDeclarations
21286 PyObject *__pyx_t_1 = NULL;
21287 int __pyx_lineno = 0;
21288 const char *__pyx_filename = NULL;
21289 int __pyx_clineno = 0;
21290 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
21299 __Pyx_XDECREF(__pyx_r);
21300 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 755, __pyx_L1_error)
21301 __Pyx_GOTREF(__pyx_t_1);
21302 __pyx_r = __pyx_t_1;
21316 __Pyx_XDECREF(__pyx_t_1);
21317 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21320 __Pyx_XGIVEREF(__pyx_r);
21321 __Pyx_RefNannyFinishContext();
21333 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
21334 PyObject *__pyx_r = NULL;
21335 __Pyx_RefNannyDeclarations
21337 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
21346 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
21356 __Pyx_XDECREF(__pyx_r);
21357 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
21358 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
21378 __Pyx_XDECREF(__pyx_r);
21379 __Pyx_INCREF(__pyx_empty_tuple);
21380 __pyx_r = __pyx_empty_tuple;
21394 __Pyx_XGIVEREF(__pyx_r);
21395 __Pyx_RefNannyFinishContext();
21407 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
21408 PyArray_Descr *__pyx_v_child = 0;
21409 int __pyx_v_endian_detector;
21410 int __pyx_v_little_endian;
21411 PyObject *__pyx_v_fields = 0;
21412 PyObject *__pyx_v_childname = NULL;
21413 PyObject *__pyx_v_new_offset = NULL;
21414 PyObject *__pyx_v_t = NULL;
21416 __Pyx_RefNannyDeclarations
21417 PyObject *__pyx_t_1 = NULL;
21418 Py_ssize_t __pyx_t_2;
21419 PyObject *__pyx_t_3 = NULL;
21420 PyObject *__pyx_t_4 = NULL;
21426 int __pyx_lineno = 0;
21427 const char *__pyx_filename = NULL;
21428 int __pyx_clineno = 0;
21429 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
21438 __pyx_v_endian_detector = 1;
21447 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
21456 if (unlikely(__pyx_v_descr->names == Py_None)) {
21457 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
21458 __PYX_ERR(1, 772, __pyx_L1_error)
21460 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
21462 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
21463 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21464 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(1, 772, __pyx_L1_error)
21466 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
21467 __Pyx_GOTREF(__pyx_t_3);
21469 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
21479 if (unlikely(__pyx_v_descr->fields == Py_None)) {
21480 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21481 __PYX_ERR(1, 773, __pyx_L1_error)
21483 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
21484 __Pyx_GOTREF(__pyx_t_3);
21485 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 773, __pyx_L1_error)
21486 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
21496 if (likely(__pyx_v_fields != Py_None)) {
21497 PyObject* sequence = __pyx_v_fields;
21498 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21499 if (unlikely(size != 2)) {
21500 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21501 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21502 __PYX_ERR(1, 774, __pyx_L1_error)
21504 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21505 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
21506 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
21507 __Pyx_INCREF(__pyx_t_3);
21508 __Pyx_INCREF(__pyx_t_4);
21510 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 774, __pyx_L1_error)
21511 __Pyx_GOTREF(__pyx_t_3);
21512 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 774, __pyx_L1_error)
21513 __Pyx_GOTREF(__pyx_t_4);
21516 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 774, __pyx_L1_error)
21518 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 774, __pyx_L1_error)
21519 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
21521 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
21531 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 776, __pyx_L1_error)
21532 __Pyx_GOTREF(__pyx_t_4);
21533 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 776, __pyx_L1_error)
21534 __Pyx_GOTREF(__pyx_t_3);
21535 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21536 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 776, __pyx_L1_error)
21537 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21538 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
21539 if (unlikely(__pyx_t_6)) {
21548 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
21549 __Pyx_GOTREF(__pyx_t_3);
21550 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21551 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21552 __PYX_ERR(1, 777, __pyx_L1_error)
21570 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
21572 goto __pyx_L8_next_or;
21575 __pyx_t_7 = (__pyx_v_little_endian != 0);
21578 __pyx_t_6 = __pyx_t_7;
21579 goto __pyx_L7_bool_binop_done;
21590 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
21593 __pyx_t_6 = __pyx_t_7;
21594 goto __pyx_L7_bool_binop_done;
21596 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
21597 __pyx_t_6 = __pyx_t_7;
21598 __pyx_L7_bool_binop_done:;
21607 if (unlikely(__pyx_t_6)) {
21616 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 781, __pyx_L1_error)
21617 __Pyx_GOTREF(__pyx_t_3);
21618 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21619 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21620 __PYX_ERR(1, 781, __pyx_L1_error)
21639 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 791, __pyx_L1_error)
21640 __Pyx_GOTREF(__pyx_t_3);
21641 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 791, __pyx_L1_error)
21642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21643 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 791, __pyx_L1_error)
21644 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21645 if (!__pyx_t_6)
break;
21654 (__pyx_v_f[0]) = 0x78;
21663 __pyx_v_f = (__pyx_v_f + 1);
21673 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
21684 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
21693 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
21703 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 799, __pyx_L1_error)
21704 __Pyx_GOTREF(__pyx_t_4);
21705 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
21715 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
21716 if (unlikely(__pyx_t_6)) {
21725 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 801, __pyx_L1_error)
21726 __Pyx_GOTREF(__pyx_t_4);
21727 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21728 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21729 __PYX_ERR(1, 801, __pyx_L1_error)
21747 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 804, __pyx_L1_error)
21748 __Pyx_GOTREF(__pyx_t_4);
21749 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 804, __pyx_L1_error)
21750 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21751 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 804, __pyx_L1_error)
21752 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21754 (__pyx_v_f[0]) = 98;
21765 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error)
21766 __Pyx_GOTREF(__pyx_t_3);
21767 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 805, __pyx_L1_error)
21768 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21769 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 805, __pyx_L1_error)
21770 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21772 (__pyx_v_f[0]) = 66;
21783 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 806, __pyx_L1_error)
21784 __Pyx_GOTREF(__pyx_t_4);
21785 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
21786 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21787 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 806, __pyx_L1_error)
21788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21790 (__pyx_v_f[0]) = 0x68;
21801 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error)
21802 __Pyx_GOTREF(__pyx_t_3);
21803 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error)
21804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21805 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 807, __pyx_L1_error)
21806 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21808 (__pyx_v_f[0]) = 72;
21819 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 808, __pyx_L1_error)
21820 __Pyx_GOTREF(__pyx_t_4);
21821 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 808, __pyx_L1_error)
21822 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21823 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 808, __pyx_L1_error)
21824 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21826 (__pyx_v_f[0]) = 0x69;
21837 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error)
21838 __Pyx_GOTREF(__pyx_t_3);
21839 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error)
21840 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21841 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 809, __pyx_L1_error)
21842 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21844 (__pyx_v_f[0]) = 73;
21855 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 810, __pyx_L1_error)
21856 __Pyx_GOTREF(__pyx_t_4);
21857 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
21858 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21859 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 810, __pyx_L1_error)
21860 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21862 (__pyx_v_f[0]) = 0x6C;
21873 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 811, __pyx_L1_error)
21874 __Pyx_GOTREF(__pyx_t_3);
21875 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 811, __pyx_L1_error)
21876 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21877 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 811, __pyx_L1_error)
21878 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21880 (__pyx_v_f[0]) = 76;
21891 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 812, __pyx_L1_error)
21892 __Pyx_GOTREF(__pyx_t_4);
21893 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 812, __pyx_L1_error)
21894 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21895 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 812, __pyx_L1_error)
21896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21898 (__pyx_v_f[0]) = 0x71;
21909 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
21910 __Pyx_GOTREF(__pyx_t_3);
21911 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
21912 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21913 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
21914 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21916 (__pyx_v_f[0]) = 81;
21927 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 814, __pyx_L1_error)
21928 __Pyx_GOTREF(__pyx_t_4);
21929 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error)
21930 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21931 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 814, __pyx_L1_error)
21932 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21934 (__pyx_v_f[0]) = 0x66;
21945 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 815, __pyx_L1_error)
21946 __Pyx_GOTREF(__pyx_t_3);
21947 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 815, __pyx_L1_error)
21948 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21949 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 815, __pyx_L1_error)
21950 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21952 (__pyx_v_f[0]) = 0x64;
21963 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 816, __pyx_L1_error)
21964 __Pyx_GOTREF(__pyx_t_4);
21965 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 816, __pyx_L1_error)
21966 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21967 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 816, __pyx_L1_error)
21968 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21970 (__pyx_v_f[0]) = 0x67;
21981 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 817, __pyx_L1_error)
21982 __Pyx_GOTREF(__pyx_t_3);
21983 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 817, __pyx_L1_error)
21984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21985 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 817, __pyx_L1_error)
21986 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21988 (__pyx_v_f[0]) = 90;
21989 (__pyx_v_f[1]) = 0x66;
21990 __pyx_v_f = (__pyx_v_f + 1);
22001 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 818, __pyx_L1_error)
22002 __Pyx_GOTREF(__pyx_t_4);
22003 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 818, __pyx_L1_error)
22004 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22005 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 818, __pyx_L1_error)
22006 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22008 (__pyx_v_f[0]) = 90;
22009 (__pyx_v_f[1]) = 0x64;
22010 __pyx_v_f = (__pyx_v_f + 1);
22021 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 819, __pyx_L1_error)
22022 __Pyx_GOTREF(__pyx_t_3);
22023 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 819, __pyx_L1_error)
22024 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22025 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 819, __pyx_L1_error)
22026 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22028 (__pyx_v_f[0]) = 90;
22029 (__pyx_v_f[1]) = 0x67;
22030 __pyx_v_f = (__pyx_v_f + 1);
22041 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 820, __pyx_L1_error)
22042 __Pyx_GOTREF(__pyx_t_4);
22043 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 820, __pyx_L1_error)
22044 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22045 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 820, __pyx_L1_error)
22046 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22047 if (likely(__pyx_t_6)) {
22048 (__pyx_v_f[0]) = 79;
22060 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error)
22061 __Pyx_GOTREF(__pyx_t_3);
22062 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error)
22063 __Pyx_GOTREF(__pyx_t_4);
22064 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22065 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22066 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22067 __PYX_ERR(1, 822, __pyx_L1_error)
22078 __pyx_v_f = (__pyx_v_f + 1);
22098 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(1, 827, __pyx_L1_error)
22099 __pyx_v_f = __pyx_t_9;
22111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22120 __pyx_r = __pyx_v_f;
22133 __Pyx_XDECREF(__pyx_t_1);
22134 __Pyx_XDECREF(__pyx_t_3);
22135 __Pyx_XDECREF(__pyx_t_4);
22136 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
22139 __Pyx_XDECREF((PyObject *)__pyx_v_child);
22140 __Pyx_XDECREF(__pyx_v_fields);
22141 __Pyx_XDECREF(__pyx_v_childname);
22142 __Pyx_XDECREF(__pyx_v_new_offset);
22143 __Pyx_XDECREF(__pyx_v_t);
22144 __Pyx_RefNannyFinishContext();
22156 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
22157 __Pyx_RefNannyDeclarations
22158 __Pyx_RefNannySetupContext(
"set_array_base", 0);
22167 Py_INCREF(__pyx_v_base);
22176 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
22187 __Pyx_RefNannyFinishContext();
22198 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
22199 PyObject *__pyx_v_base;
22200 PyObject *__pyx_r = NULL;
22201 __Pyx_RefNannyDeclarations
22203 __Pyx_RefNannySetupContext(
"get_array_base", 0);
22212 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
22221 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
22231 __Pyx_XDECREF(__pyx_r);
22232 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22251 __Pyx_XDECREF(__pyx_r);
22252 __Pyx_INCREF(((PyObject *)__pyx_v_base));
22253 __pyx_r = ((PyObject *)__pyx_v_base);
22266 __Pyx_XGIVEREF(__pyx_r);
22267 __Pyx_RefNannyFinishContext();
22279 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
22281 __Pyx_RefNannyDeclarations
22282 PyObject *__pyx_t_1 = NULL;
22283 PyObject *__pyx_t_2 = NULL;
22284 PyObject *__pyx_t_3 = NULL;
22286 PyObject *__pyx_t_5 = NULL;
22287 PyObject *__pyx_t_6 = NULL;
22288 PyObject *__pyx_t_7 = NULL;
22289 PyObject *__pyx_t_8 = NULL;
22290 int __pyx_lineno = 0;
22291 const char *__pyx_filename = NULL;
22292 int __pyx_clineno = 0;
22293 __Pyx_RefNannySetupContext(
"import_array", 0);
22303 __Pyx_PyThreadState_declare
22304 __Pyx_PyThreadState_assign
22305 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22306 __Pyx_XGOTREF(__pyx_t_1);
22307 __Pyx_XGOTREF(__pyx_t_2);
22308 __Pyx_XGOTREF(__pyx_t_3);
22318 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L3_error)
22328 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22329 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22330 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22331 goto __pyx_L8_try_end;
22341 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22343 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22344 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 958, __pyx_L5_except_error)
22345 __Pyx_GOTREF(__pyx_t_5);
22346 __Pyx_GOTREF(__pyx_t_6);
22347 __Pyx_GOTREF(__pyx_t_7);
22356 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 959, __pyx_L5_except_error)
22357 __Pyx_GOTREF(__pyx_t_8);
22358 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22359 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22360 __PYX_ERR(1, 959, __pyx_L5_except_error)
22362 goto __pyx_L5_except_error;
22363 __pyx_L5_except_error:;
22372 __Pyx_XGIVEREF(__pyx_t_1);
22373 __Pyx_XGIVEREF(__pyx_t_2);
22374 __Pyx_XGIVEREF(__pyx_t_3);
22375 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22376 goto __pyx_L1_error;
22392 __Pyx_XDECREF(__pyx_t_5);
22393 __Pyx_XDECREF(__pyx_t_6);
22394 __Pyx_XDECREF(__pyx_t_7);
22395 __Pyx_XDECREF(__pyx_t_8);
22396 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22399 __Pyx_RefNannyFinishContext();
22411 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
22413 __Pyx_RefNannyDeclarations
22414 PyObject *__pyx_t_1 = NULL;
22415 PyObject *__pyx_t_2 = NULL;
22416 PyObject *__pyx_t_3 = NULL;
22418 PyObject *__pyx_t_5 = NULL;
22419 PyObject *__pyx_t_6 = NULL;
22420 PyObject *__pyx_t_7 = NULL;
22421 PyObject *__pyx_t_8 = NULL;
22422 int __pyx_lineno = 0;
22423 const char *__pyx_filename = NULL;
22424 int __pyx_clineno = 0;
22425 __Pyx_RefNannySetupContext(
"import_umath", 0);
22435 __Pyx_PyThreadState_declare
22436 __Pyx_PyThreadState_assign
22437 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22438 __Pyx_XGOTREF(__pyx_t_1);
22439 __Pyx_XGOTREF(__pyx_t_2);
22440 __Pyx_XGOTREF(__pyx_t_3);
22450 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 963, __pyx_L3_error)
22460 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22461 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22462 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22463 goto __pyx_L8_try_end;
22473 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22475 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22476 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 964, __pyx_L5_except_error)
22477 __Pyx_GOTREF(__pyx_t_5);
22478 __Pyx_GOTREF(__pyx_t_6);
22479 __Pyx_GOTREF(__pyx_t_7);
22488 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 965, __pyx_L5_except_error)
22489 __Pyx_GOTREF(__pyx_t_8);
22490 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22491 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22492 __PYX_ERR(1, 965, __pyx_L5_except_error)
22494 goto __pyx_L5_except_error;
22495 __pyx_L5_except_error:;
22504 __Pyx_XGIVEREF(__pyx_t_1);
22505 __Pyx_XGIVEREF(__pyx_t_2);
22506 __Pyx_XGIVEREF(__pyx_t_3);
22507 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22508 goto __pyx_L1_error;
22524 __Pyx_XDECREF(__pyx_t_5);
22525 __Pyx_XDECREF(__pyx_t_6);
22526 __Pyx_XDECREF(__pyx_t_7);
22527 __Pyx_XDECREF(__pyx_t_8);
22528 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22531 __Pyx_RefNannyFinishContext();
22543 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
22545 __Pyx_RefNannyDeclarations
22546 PyObject *__pyx_t_1 = NULL;
22547 PyObject *__pyx_t_2 = NULL;
22548 PyObject *__pyx_t_3 = NULL;
22550 PyObject *__pyx_t_5 = NULL;
22551 PyObject *__pyx_t_6 = NULL;
22552 PyObject *__pyx_t_7 = NULL;
22553 PyObject *__pyx_t_8 = NULL;
22554 int __pyx_lineno = 0;
22555 const char *__pyx_filename = NULL;
22556 int __pyx_clineno = 0;
22557 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
22567 __Pyx_PyThreadState_declare
22568 __Pyx_PyThreadState_assign
22569 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22570 __Pyx_XGOTREF(__pyx_t_1);
22571 __Pyx_XGOTREF(__pyx_t_2);
22572 __Pyx_XGOTREF(__pyx_t_3);
22582 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 969, __pyx_L3_error)
22592 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22593 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22594 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22595 goto __pyx_L8_try_end;
22605 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22607 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22608 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 970, __pyx_L5_except_error)
22609 __Pyx_GOTREF(__pyx_t_5);
22610 __Pyx_GOTREF(__pyx_t_6);
22611 __Pyx_GOTREF(__pyx_t_7);
22620 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 971, __pyx_L5_except_error)
22621 __Pyx_GOTREF(__pyx_t_8);
22622 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22623 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22624 __PYX_ERR(1, 971, __pyx_L5_except_error)
22626 goto __pyx_L5_except_error;
22627 __pyx_L5_except_error:;
22636 __Pyx_XGIVEREF(__pyx_t_1);
22637 __Pyx_XGIVEREF(__pyx_t_2);
22638 __Pyx_XGIVEREF(__pyx_t_3);
22639 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22640 goto __pyx_L1_error;
22656 __Pyx_XDECREF(__pyx_t_5);
22657 __Pyx_XDECREF(__pyx_t_6);
22658 __Pyx_XDECREF(__pyx_t_7);
22659 __Pyx_XDECREF(__pyx_t_8);
22660 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22663 __Pyx_RefNannyFinishContext();
22667 static PyMethodDef __pyx_methods[] = {
22671 #if PY_MAJOR_VERSION >= 3
22672 #if CYTHON_PEP489_MULTI_PHASE_INIT
22673 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22674 static int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject* module);
22675 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22676 {Py_mod_create, (
void*)__pyx_pymod_create},
22677 {Py_mod_exec, (
void*)__pyx_pymod_exec_subsurfaceTransportFunctions},
22682 static struct PyModuleDef __pyx_moduledef = {
22683 PyModuleDef_HEAD_INIT,
22684 "subsurfaceTransportFunctions",
22686 #if CYTHON_PEP489_MULTI_PHASE_INIT
22692 #if CYTHON_PEP489_MULTI_PHASE_INIT
22693 __pyx_moduledef_slots,
22702 #ifndef CYTHON_SMALL_CODE
22703 #if defined(__clang__)
22704 #define CYTHON_SMALL_CODE
22705 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22706 #define CYTHON_SMALL_CODE __attribute__((cold))
22708 #define CYTHON_SMALL_CODE
22712 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22713 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
22714 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
22715 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
22716 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
22717 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22718 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22719 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
22720 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22721 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
22722 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
22723 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
22724 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22725 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
22726 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
22727 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
22728 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
22729 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22730 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22731 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
22732 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
22733 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
22734 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
22735 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
22736 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
22737 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
22738 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
22739 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
22740 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22741 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
22742 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
22743 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
22744 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
22745 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
22746 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
22747 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
22748 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
22749 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
22750 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
22751 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
22752 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
22753 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
22754 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
22755 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
22756 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
22757 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
22758 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
22759 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
22760 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
22761 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
22762 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
22763 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
22764 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
22765 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
22766 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
22767 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
22768 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
22769 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
22770 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
22771 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
22772 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
22773 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
22774 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
22775 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
22776 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
22777 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
22778 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
22779 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
22780 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
22781 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
22782 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
22783 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
22784 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
22785 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
22786 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
22787 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
22788 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
22789 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22790 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
22791 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22792 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
22793 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
22794 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
22795 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
22796 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
22797 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
22798 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
22799 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
22800 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
22801 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22802 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
22803 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
22804 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
22805 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
22806 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
22807 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
22808 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
22809 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
22810 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22811 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
22812 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
22813 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
22814 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
22815 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
22816 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
22817 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
22818 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22819 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
22820 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22821 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22822 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22823 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
22824 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22825 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22826 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22827 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
22828 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
22829 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
22830 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
22831 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
22832 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
22833 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
22834 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
22835 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
22836 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
22837 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
22838 {&__pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_k_proteus_subsurfaceTransportFunct,
sizeof(__pyx_k_proteus_subsurfaceTransportFunct), 0, 0, 1, 0},
22839 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
22840 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
22841 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
22842 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
22843 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
22844 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
22845 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
22846 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
22847 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
22848 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
22849 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
22850 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
22851 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
22852 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
22853 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
22854 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
22855 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
22856 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
22857 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
22858 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
22859 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
22860 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22861 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
22862 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
22863 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
22864 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
22865 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
22866 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22867 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
22868 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
22869 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
22870 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
22871 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
22872 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
22873 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
22874 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
22875 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
22876 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22877 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
22878 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
22879 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22880 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22881 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
22882 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22883 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
22884 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
22885 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
22886 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
22887 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
22888 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
22889 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
22890 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
22891 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
22892 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
22893 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
22894 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22895 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
22896 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
22897 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
22898 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
22899 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
22900 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
22901 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
22902 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
22903 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
22904 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
22905 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
22906 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
22907 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22908 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
22909 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
22910 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22911 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
22912 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
22913 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
22914 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22915 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
22916 {0, 0, 0, 0, 0, 0, 0}
22918 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
22919 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
22920 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 777, __pyx_L1_error)
22921 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 781, __pyx_L1_error)
22922 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 959, __pyx_L1_error)
22928 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
22929 __Pyx_RefNannyDeclarations
22930 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22939 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
22940 __Pyx_GOTREF(__pyx_slice_);
22941 __Pyx_GIVEREF(__pyx_slice_);
22950 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 777, __pyx_L1_error)
22951 __Pyx_GOTREF(__pyx_tuple__2);
22952 __Pyx_GIVEREF(__pyx_tuple__2);
22961 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 781, __pyx_L1_error)
22962 __Pyx_GOTREF(__pyx_tuple__3);
22963 __Pyx_GIVEREF(__pyx_tuple__3);
22972 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 801, __pyx_L1_error)
22973 __Pyx_GOTREF(__pyx_tuple__4);
22974 __Pyx_GIVEREF(__pyx_tuple__4);
22983 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 959, __pyx_L1_error)
22984 __Pyx_GOTREF(__pyx_tuple__5);
22985 __Pyx_GIVEREF(__pyx_tuple__5);
22994 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 965, __pyx_L1_error)
22995 __Pyx_GOTREF(__pyx_tuple__6);
22996 __Pyx_GIVEREF(__pyx_tuple__6);
23005 __pyx_tuple__7 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 18, __pyx_L1_error)
23006 __Pyx_GOTREF(__pyx_tuple__7);
23007 __Pyx_GIVEREF(__pyx_tuple__7);
23008 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 18, __pyx_L1_error)
23017 __pyx_tuple__9 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 29, __pyx_L1_error)
23018 __Pyx_GOTREF(__pyx_tuple__9);
23019 __Pyx_GIVEREF(__pyx_tuple__9);
23020 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 29, __pyx_L1_error)
23029 __pyx_tuple__11 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 43, __pyx_L1_error)
23030 __Pyx_GOTREF(__pyx_tuple__11);
23031 __Pyx_GIVEREF(__pyx_tuple__11);
23032 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 43, __pyx_L1_error)
23041 __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 56, __pyx_L1_error)
23042 __Pyx_GOTREF(__pyx_tuple__13);
23043 __Pyx_GIVEREF(__pyx_tuple__13);
23044 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 56, __pyx_L1_error)
23053 __pyx_tuple__15 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 69, __pyx_L1_error)
23054 __Pyx_GOTREF(__pyx_tuple__15);
23055 __Pyx_GIVEREF(__pyx_tuple__15);
23056 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 69, __pyx_L1_error)
23065 __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 91, __pyx_L1_error)
23066 __Pyx_GOTREF(__pyx_tuple__17);
23067 __Pyx_GIVEREF(__pyx_tuple__17);
23068 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 91, __pyx_L1_error)
23077 __pyx_tuple__19 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 118, __pyx_L1_error)
23078 __Pyx_GOTREF(__pyx_tuple__19);
23079 __Pyx_GIVEREF(__pyx_tuple__19);
23080 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 118, __pyx_L1_error)
23089 __pyx_tuple__21 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 139, __pyx_L1_error)
23090 __Pyx_GOTREF(__pyx_tuple__21);
23091 __Pyx_GIVEREF(__pyx_tuple__21);
23092 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 139, __pyx_L1_error)
23101 __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 165, __pyx_L1_error)
23102 __Pyx_GOTREF(__pyx_tuple__23);
23103 __Pyx_GIVEREF(__pyx_tuple__23);
23104 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 165, __pyx_L1_error)
23113 __pyx_tuple__25 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 180, __pyx_L1_error)
23114 __Pyx_GOTREF(__pyx_tuple__25);
23115 __Pyx_GIVEREF(__pyx_tuple__25);
23116 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 180, __pyx_L1_error)
23125 __pyx_tuple__27 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 195, __pyx_L1_error)
23126 __Pyx_GOTREF(__pyx_tuple__27);
23127 __Pyx_GIVEREF(__pyx_tuple__27);
23128 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 195, __pyx_L1_error)
23137 __pyx_tuple__29 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 219, __pyx_L1_error)
23138 __Pyx_GOTREF(__pyx_tuple__29);
23139 __Pyx_GIVEREF(__pyx_tuple__29);
23140 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 219, __pyx_L1_error)
23149 __pyx_tuple__31 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 248, __pyx_L1_error)
23150 __Pyx_GOTREF(__pyx_tuple__31);
23151 __Pyx_GIVEREF(__pyx_tuple__31);
23152 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 248, __pyx_L1_error)
23161 __pyx_tuple__33 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 271, __pyx_L1_error)
23162 __Pyx_GOTREF(__pyx_tuple__33);
23163 __Pyx_GIVEREF(__pyx_tuple__33);
23164 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 271, __pyx_L1_error)
23173 __pyx_tuple__35 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 301, __pyx_L1_error)
23174 __Pyx_GOTREF(__pyx_tuple__35);
23175 __Pyx_GIVEREF(__pyx_tuple__35);
23176 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 301, __pyx_L1_error)
23185 __pyx_tuple__37 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 359, __pyx_L1_error)
23186 __Pyx_GOTREF(__pyx_tuple__37);
23187 __Pyx_GIVEREF(__pyx_tuple__37);
23188 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 359, __pyx_L1_error)
23197 __pyx_tuple__39 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 486, __pyx_L1_error)
23198 __Pyx_GOTREF(__pyx_tuple__39);
23199 __Pyx_GIVEREF(__pyx_tuple__39);
23200 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 486, __pyx_L1_error)
23209 __pyx_tuple__41 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 574, __pyx_L1_error)
23210 __Pyx_GOTREF(__pyx_tuple__41);
23211 __Pyx_GIVEREF(__pyx_tuple__41);
23212 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 574, __pyx_L1_error)
23221 __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 673, __pyx_L1_error)
23222 __Pyx_GOTREF(__pyx_tuple__43);
23223 __Pyx_GIVEREF(__pyx_tuple__43);
23224 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 673, __pyx_L1_error)
23233 __pyx_tuple__45 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 692, __pyx_L1_error)
23234 __Pyx_GOTREF(__pyx_tuple__45);
23235 __Pyx_GIVEREF(__pyx_tuple__45);
23236 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 692, __pyx_L1_error)
23245 __pyx_tuple__47 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 717, __pyx_L1_error)
23246 __Pyx_GOTREF(__pyx_tuple__47);
23247 __Pyx_GIVEREF(__pyx_tuple__47);
23248 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 717, __pyx_L1_error)
23257 __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 732, __pyx_L1_error)
23258 __Pyx_GOTREF(__pyx_tuple__49);
23259 __Pyx_GIVEREF(__pyx_tuple__49);
23260 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 732, __pyx_L1_error)
23269 __pyx_tuple__51 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 753, __pyx_L1_error)
23270 __Pyx_GOTREF(__pyx_tuple__51);
23271 __Pyx_GIVEREF(__pyx_tuple__51);
23272 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 753, __pyx_L1_error)
23281 __pyx_tuple__53 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 776, __pyx_L1_error)
23282 __Pyx_GOTREF(__pyx_tuple__53);
23283 __Pyx_GIVEREF(__pyx_tuple__53);
23284 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 776, __pyx_L1_error)
23293 __pyx_tuple__55 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 816, __pyx_L1_error)
23294 __Pyx_GOTREF(__pyx_tuple__55);
23295 __Pyx_GIVEREF(__pyx_tuple__55);
23296 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 816, __pyx_L1_error)
23305 __pyx_tuple__57 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 859, __pyx_L1_error)
23306 __Pyx_GOTREF(__pyx_tuple__57);
23307 __Pyx_GIVEREF(__pyx_tuple__57);
23308 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 859, __pyx_L1_error)
23317 __pyx_tuple__59 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 884, __pyx_L1_error)
23318 __Pyx_GOTREF(__pyx_tuple__59);
23319 __Pyx_GIVEREF(__pyx_tuple__59);
23320 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 884, __pyx_L1_error)
23329 __pyx_tuple__61 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 911, __pyx_L1_error)
23330 __Pyx_GOTREF(__pyx_tuple__61);
23331 __Pyx_GIVEREF(__pyx_tuple__61);
23332 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 911, __pyx_L1_error)
23341 __pyx_tuple__63 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 924, __pyx_L1_error)
23342 __Pyx_GOTREF(__pyx_tuple__63);
23343 __Pyx_GIVEREF(__pyx_tuple__63);
23344 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_subsurfaceTransportFunct, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 924, __pyx_L1_error)
23345 __Pyx_RefNannyFinishContext();
23348 __Pyx_RefNannyFinishContext();
23352 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
23353 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23354 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23355 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
23356 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23357 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
23363 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
23364 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
23365 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
23366 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
23367 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
23368 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
23369 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
23371 static int __Pyx_modinit_global_init_code(
void) {
23372 __Pyx_RefNannyDeclarations
23373 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23375 __Pyx_RefNannyFinishContext();
23379 static int __Pyx_modinit_variable_export_code(
void) {
23380 __Pyx_RefNannyDeclarations
23381 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23383 __Pyx_RefNannyFinishContext();
23387 static int __Pyx_modinit_function_export_code(
void) {
23388 __Pyx_RefNannyDeclarations
23389 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23391 __Pyx_RefNannyFinishContext();
23395 static int __Pyx_modinit_type_init_code(
void) {
23396 __Pyx_RefNannyDeclarations
23397 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23399 __Pyx_RefNannyFinishContext();
23403 static int __Pyx_modinit_type_import_code(
void) {
23404 __Pyx_RefNannyDeclarations
23405 PyObject *__pyx_t_1 = NULL;
23406 int __pyx_lineno = 0;
23407 const char *__pyx_filename = NULL;
23408 int __pyx_clineno = 0;
23409 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23411 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
23412 __Pyx_GOTREF(__pyx_t_1);
23413 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
23414 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23415 sizeof(PyTypeObject),
23417 sizeof(PyHeapTypeObject),
23419 __Pyx_ImportType_CheckSize_Warn);
23420 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
23421 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23422 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
23423 __Pyx_GOTREF(__pyx_t_1);
23424 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23425 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 207, __pyx_L1_error)
23426 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23427 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 230, __pyx_L1_error)
23428 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23429 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 234, __pyx_L1_error)
23430 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23431 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 246, __pyx_L1_error)
23432 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23433 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 839, __pyx_L1_error)
23434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23435 __Pyx_RefNannyFinishContext();
23438 __Pyx_XDECREF(__pyx_t_1);
23439 __Pyx_RefNannyFinishContext();
23443 static int __Pyx_modinit_variable_import_code(
void) {
23444 __Pyx_RefNannyDeclarations
23445 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23447 __Pyx_RefNannyFinishContext();
23451 static int __Pyx_modinit_function_import_code(
void) {
23452 __Pyx_RefNannyDeclarations
23453 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23455 __Pyx_RefNannyFinishContext();
23460 #ifndef CYTHON_NO_PYINIT_EXPORT
23461 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23462 #elif PY_MAJOR_VERSION < 3
23464 #define __Pyx_PyMODINIT_FUNC extern "C" void
23466 #define __Pyx_PyMODINIT_FUNC void
23470 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23472 #define __Pyx_PyMODINIT_FUNC PyObject *
23477 #if PY_MAJOR_VERSION < 3
23478 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
23479 __Pyx_PyMODINIT_FUNC initsubsurfaceTransportFunctions(
void)
23481 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void) CYTHON_SMALL_CODE;
23482 __Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(
void)
23483 #if CYTHON_PEP489_MULTI_PHASE_INIT
23485 return PyModuleDef_Init(&__pyx_moduledef);
23487 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
23488 #if PY_VERSION_HEX >= 0x030700A1
23489 static PY_INT64_T main_interpreter_id = -1;
23490 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23491 if (main_interpreter_id == -1) {
23492 main_interpreter_id = current_id;
23493 return (unlikely(current_id == -1)) ? -1 : 0;
23494 }
else if (unlikely(main_interpreter_id != current_id))
23496 static PyInterpreterState *main_interpreter = NULL;
23497 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23498 if (!main_interpreter) {
23499 main_interpreter = current_interpreter;
23500 }
else if (unlikely(main_interpreter != current_interpreter))
23505 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23510 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
23511 PyObject *value = PyObject_GetAttrString(spec, from_name);
23513 if (likely(value)) {
23514 if (allow_none || value != Py_None) {
23515 result = PyDict_SetItemString(moddict, to_name, value);
23518 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23525 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23526 PyObject *module = NULL, *moddict, *modname;
23527 if (__Pyx_check_single_interpreter())
23530 return __Pyx_NewRef(__pyx_m);
23531 modname = PyObject_GetAttrString(spec,
"name");
23532 if (unlikely(!modname))
goto bad;
23533 module = PyModule_NewObject(modname);
23534 Py_DECREF(modname);
23535 if (unlikely(!module))
goto bad;
23536 moddict = PyModule_GetDict(module);
23537 if (unlikely(!moddict))
goto bad;
23538 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
23539 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
23540 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
23541 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
23544 Py_XDECREF(module);
23549 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_subsurfaceTransportFunctions(PyObject *__pyx_pyinit_module)
23553 PyObject *__pyx_t_1 = NULL;
23554 int __pyx_lineno = 0;
23555 const char *__pyx_filename = NULL;
23556 int __pyx_clineno = 0;
23557 __Pyx_RefNannyDeclarations
23558 #if CYTHON_PEP489_MULTI_PHASE_INIT
23560 if (__pyx_m == __pyx_pyinit_module)
return 0;
23561 PyErr_SetString(PyExc_RuntimeError,
"Module 'subsurfaceTransportFunctions' has already been imported. Re-initialisation is not supported.");
23564 #elif PY_MAJOR_VERSION >= 3
23565 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23567 #if CYTHON_REFNANNY
23568 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23569 if (!__Pyx_RefNanny) {
23571 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23572 if (!__Pyx_RefNanny)
23573 Py_FatalError(
"failed to import 'refnanny' module");
23576 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
23577 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23578 #ifdef __Pxy_PyFrame_Initialize_Offsets
23579 __Pxy_PyFrame_Initialize_Offsets();
23581 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23582 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23583 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23584 #ifdef __Pyx_CyFunction_USED
23585 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23587 #ifdef __Pyx_FusedFunction_USED
23588 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23590 #ifdef __Pyx_Coroutine_USED
23591 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23593 #ifdef __Pyx_Generator_USED
23594 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23596 #ifdef __Pyx_AsyncGen_USED
23597 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23599 #ifdef __Pyx_StopAsyncIteration_USED
23600 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23604 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23606 PyEval_InitThreads();
23610 #if CYTHON_PEP489_MULTI_PHASE_INIT
23611 __pyx_m = __pyx_pyinit_module;
23612 Py_INCREF(__pyx_m);
23614 #if PY_MAJOR_VERSION < 3
23615 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23617 __pyx_m = PyModule_Create(&__pyx_moduledef);
23619 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23621 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23622 Py_INCREF(__pyx_d);
23623 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23624 Py_INCREF(__pyx_b);
23625 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23626 Py_INCREF(__pyx_cython_runtime);
23627 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23629 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23630 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23631 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23633 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
23634 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23636 #if PY_MAJOR_VERSION >= 3
23638 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23639 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
23640 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23645 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23647 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23649 (void)__Pyx_modinit_global_init_code();
23650 (void)__Pyx_modinit_variable_export_code();
23651 (void)__Pyx_modinit_function_export_code();
23652 (void)__Pyx_modinit_type_init_code();
23653 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23654 (void)__Pyx_modinit_variable_import_code();
23655 (void)__Pyx_modinit_function_import_code();
23657 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23658 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23666 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23667 __Pyx_GOTREF(__pyx_t_1);
23668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23678 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
23679 __Pyx_GOTREF(__pyx_t_1);
23680 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
23681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23690 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
23691 __Pyx_GOTREF(__pyx_t_1);
23692 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
23693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23702 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
23703 __Pyx_GOTREF(__pyx_t_1);
23704 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
23705 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23714 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23715 __Pyx_GOTREF(__pyx_t_1);
23716 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
23717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23726 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
23727 __Pyx_GOTREF(__pyx_t_1);
23728 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
23729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23738 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
23739 __Pyx_GOTREF(__pyx_t_1);
23740 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
23741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23750 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
23751 __Pyx_GOTREF(__pyx_t_1);
23752 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
23753 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23762 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
23763 __Pyx_GOTREF(__pyx_t_1);
23764 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
23765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23774 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23775 __Pyx_GOTREF(__pyx_t_1);
23776 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23786 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
23787 __Pyx_GOTREF(__pyx_t_1);
23788 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
23789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23798 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
23799 __Pyx_GOTREF(__pyx_t_1);
23800 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
23801 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23810 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
23811 __Pyx_GOTREF(__pyx_t_1);
23812 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
23813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23822 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
23823 __Pyx_GOTREF(__pyx_t_1);
23824 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
23825 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23834 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
23835 __Pyx_GOTREF(__pyx_t_1);
23836 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
23837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23846 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
23847 __Pyx_GOTREF(__pyx_t_1);
23848 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
23849 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23858 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
23859 __Pyx_GOTREF(__pyx_t_1);
23860 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
23861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23870 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
23871 __Pyx_GOTREF(__pyx_t_1);
23872 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
23873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23882 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
23883 __Pyx_GOTREF(__pyx_t_1);
23884 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
23885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23894 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
23895 __Pyx_GOTREF(__pyx_t_1);
23896 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
23897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23906 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
23907 __Pyx_GOTREF(__pyx_t_1);
23908 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
23909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23918 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
23919 __Pyx_GOTREF(__pyx_t_1);
23920 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
23921 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23930 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
23931 __Pyx_GOTREF(__pyx_t_1);
23932 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
23933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23942 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
23943 __Pyx_GOTREF(__pyx_t_1);
23944 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
23945 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23954 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
23955 __Pyx_GOTREF(__pyx_t_1);
23956 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
23957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23966 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
23967 __Pyx_GOTREF(__pyx_t_1);
23968 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
23969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23978 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
23979 __Pyx_GOTREF(__pyx_t_1);
23980 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
23981 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23990 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
23991 __Pyx_GOTREF(__pyx_t_1);
23992 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
23993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24002 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
24003 __Pyx_GOTREF(__pyx_t_1);
24004 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
24005 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24014 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
24015 __Pyx_GOTREF(__pyx_t_1);
24016 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
24017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24024 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24025 __Pyx_GOTREF(__pyx_t_1);
24026 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24041 __Pyx_XDECREF(__pyx_t_1);
24044 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24047 }
else if (!PyErr_Occurred()) {
24048 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
24051 __Pyx_RefNannyFinishContext();
24052 #if CYTHON_PEP489_MULTI_PHASE_INIT
24053 return (__pyx_m != NULL) ? 0 : -1;
24054 #elif PY_MAJOR_VERSION >= 3
24063 #if CYTHON_REFNANNY
24064 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24065 PyObject *m = NULL, *p = NULL;
24067 m = PyImport_ImportModule(modname);
24069 p = PyObject_GetAttrString(m,
"RefNannyAPI");
24071 r = PyLong_AsVoidPtr(p);
24075 return (__Pyx_RefNannyAPIStruct *)
r;
24080 #if CYTHON_USE_TYPE_SLOTS
24081 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24082 PyTypeObject* tp = Py_TYPE(obj);
24083 if (likely(tp->tp_getattro))
24084 return tp->tp_getattro(obj, attr_name);
24085 #if PY_MAJOR_VERSION < 3
24086 if (likely(tp->tp_getattr))
24087 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24089 return PyObject_GetAttr(obj, attr_name);
24094 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24095 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24096 if (unlikely(!result)) {
24097 PyErr_Format(PyExc_NameError,
24098 #
if PY_MAJOR_VERSION >= 3
24099 "name '%U' is not defined", name);
24101 "name '%.200s' is not defined", PyString_AS_STRING(name));
24108 static void __Pyx_RaiseArgtupleInvalid(
24109 const char* func_name,
24111 Py_ssize_t num_min,
24112 Py_ssize_t num_max,
24113 Py_ssize_t num_found)
24115 Py_ssize_t num_expected;
24116 const char *more_or_less;
24117 if (num_found < num_min) {
24118 num_expected = num_min;
24119 more_or_less =
"at least";
24121 num_expected = num_max;
24122 more_or_less =
"at most";
24125 more_or_less =
"exactly";
24127 PyErr_Format(PyExc_TypeError,
24128 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24129 func_name, more_or_less, num_expected,
24130 (num_expected == 1) ?
"" :
"s", num_found);
24134 static void __Pyx_RaiseDoubleKeywordsError(
24135 const char* func_name,
24138 PyErr_Format(PyExc_TypeError,
24139 #
if PY_MAJOR_VERSION >= 3
24140 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24142 "%s() got multiple values for keyword argument '%s'", func_name,
24143 PyString_AsString(kw_name));
24148 static int __Pyx_ParseOptionalKeywords(
24150 PyObject **argnames[],
24152 PyObject *values[],
24153 Py_ssize_t num_pos_args,
24154 const char* function_name)
24156 PyObject *key = 0, *value = 0;
24157 Py_ssize_t
pos = 0;
24159 PyObject*** first_kw_arg = argnames + num_pos_args;
24160 while (PyDict_Next(kwds, &
pos, &key, &value)) {
24161 name = first_kw_arg;
24162 while (*name && (**name != key)) name++;
24164 values[name-argnames] = value;
24167 name = first_kw_arg;
24168 #if PY_MAJOR_VERSION < 3
24169 if (likely(PyString_Check(key))) {
24171 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24172 && _PyString_Eq(**name, key)) {
24173 values[name-argnames] = value;
24178 if (*name)
continue;
24180 PyObject*** argname = argnames;
24181 while (argname != first_kw_arg) {
24182 if ((**argname == key) || (
24183 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24184 && _PyString_Eq(**argname, key))) {
24185 goto arg_passed_twice;
24192 if (likely(PyUnicode_Check(key))) {
24194 int cmp = (**name == key) ? 0 :
24195 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24196 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24198 PyUnicode_Compare(**name, key);
24199 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24201 values[name-argnames] = value;
24206 if (*name)
continue;
24208 PyObject*** argname = argnames;
24209 while (argname != first_kw_arg) {
24210 int cmp = (**argname == key) ? 0 :
24211 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24212 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24214 PyUnicode_Compare(**argname, key);
24215 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24216 if (cmp == 0)
goto arg_passed_twice;
24221 goto invalid_keyword_type;
24223 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24225 goto invalid_keyword;
24230 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24232 invalid_keyword_type:
24233 PyErr_Format(PyExc_TypeError,
24234 "%.200s() keywords must be strings", function_name);
24237 PyErr_Format(PyExc_TypeError,
24238 #
if PY_MAJOR_VERSION < 3
24239 "%.200s() got an unexpected keyword argument '%.200s'",
24240 function_name, PyString_AsString(key));
24242 "%s() got an unexpected keyword argument '%U'",
24243 function_name, key);
24250 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24252 if (unlikely(!type)) {
24253 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24257 #if PY_MAJOR_VERSION == 2
24258 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24262 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24264 PyErr_Format(PyExc_TypeError,
24265 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24266 name, type->tp_name, Py_TYPE(obj)->tp_name);
24271 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
24277 S.u32 = 0x01020304;
24278 return S.u8[0] == 4;
24282 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
24283 __Pyx_BufFmt_StackElem* stack,
24284 __Pyx_TypeInfo* type) {
24285 stack[0].field = &ctx->root;
24286 stack[0].parent_offset = 0;
24287 ctx->root.type = type;
24288 ctx->root.name =
"buffer dtype";
24289 ctx->root.offset = 0;
24291 ctx->head->field = &ctx->root;
24292 ctx->fmt_offset = 0;
24293 ctx->head->parent_offset = 0;
24294 ctx->new_packmode =
'@';
24295 ctx->enc_packmode =
'@';
24296 ctx->new_count = 1;
24297 ctx->enc_count = 0;
24299 ctx->is_complex = 0;
24300 ctx->is_valid_array = 0;
24301 ctx->struct_alignment = 0;
24302 while (type->typegroup ==
'S') {
24304 ctx->head->field = type->fields;
24305 ctx->head->parent_offset = 0;
24306 type = type->fields->type;
24309 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
24311 const char* t = *ts;
24312 if (*t < '0' || *t >
'9') {
24315 count = *t++ -
'0';
24316 while (*t >=
'0' && *t <=
'9') {
24318 count += *t++ -
'0';
24324 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
24325 int number = __Pyx_BufFmt_ParseNumber(ts);
24327 PyErr_Format(PyExc_ValueError,\
24328 "Does not understand character buffer dtype format string ('%c')", **ts);
24331 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
24332 PyErr_Format(PyExc_ValueError,
24333 "Unexpected format string character: '%c'", ch);
24335 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
24337 case '?':
return "'bool'";
24338 case 'c':
return "'char'";
24339 case 'b':
return "'signed char'";
24340 case 'B':
return "'unsigned char'";
24341 case 'h':
return "'short'";
24342 case 'H':
return "'unsigned short'";
24343 case 'i':
return "'int'";
24344 case 'I':
return "'unsigned int'";
24345 case 'l':
return "'long'";
24346 case 'L':
return "'unsigned long'";
24347 case 'q':
return "'long long'";
24348 case 'Q':
return "'unsigned long long'";
24349 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
24350 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
24351 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
24352 case 'T':
return "a struct";
24353 case 'O':
return "Python object";
24354 case 'P':
return "a pointer";
24355 case 's':
case 'p':
return "a string";
24356 case 0:
return "end";
24357 default:
return "unparseable format string";
24360 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
24362 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24363 case 'h':
case 'H':
return 2;
24364 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
24365 case 'q':
case 'Q':
return 8;
24366 case 'f':
return (is_complex ? 8 : 4);
24367 case 'd':
return (is_complex ? 16 : 8);
24369 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
24372 case 'O':
case 'P':
return sizeof(
void*);
24374 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24378 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
24380 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24381 case 'h':
case 'H':
return sizeof(short);
24382 case 'i':
case 'I':
return sizeof(int);
24383 case 'l':
case 'L':
return sizeof(long);
24384 #ifdef HAVE_LONG_LONG
24385 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
24387 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
24388 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
24389 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
24390 case 'O':
case 'P':
return sizeof(
void*);
24392 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24397 typedef struct {
char c;
short x; } __Pyx_st_short;
24398 typedef struct {
char c;
int x; } __Pyx_st_int;
24399 typedef struct {
char c;
long x; } __Pyx_st_long;
24400 typedef struct {
char c;
float x; } __Pyx_st_float;
24401 typedef struct {
char c;
double x; } __Pyx_st_double;
24402 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
24403 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
24404 #ifdef HAVE_LONG_LONG
24405 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
24407 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
24409 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24410 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
24411 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
24412 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
24413 #ifdef HAVE_LONG_LONG
24414 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
24416 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
24417 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
24418 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
24419 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
24421 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24429 typedef struct {
short x;
char c; } __Pyx_pad_short;
24430 typedef struct {
int x;
char c; } __Pyx_pad_int;
24431 typedef struct {
long x;
char c; } __Pyx_pad_long;
24432 typedef struct {
float x;
char c; } __Pyx_pad_float;
24433 typedef struct {
double x;
char c; } __Pyx_pad_double;
24434 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
24435 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
24436 #ifdef HAVE_LONG_LONG
24437 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
24439 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
24441 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24442 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
24443 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
24444 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
24445 #ifdef HAVE_LONG_LONG
24446 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
24448 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
24449 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
24450 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
24451 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
24453 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24457 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
24461 case 'b':
case 'h':
case 'i':
24462 case 'l':
case 'q':
case 's':
case 'p':
24464 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
24466 case 'f':
case 'd':
case 'g':
24467 return (is_complex ?
'C' :
'R');
24473 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24478 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
24479 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
24480 const char* expected;
24482 if (ctx->head == NULL) {
24486 expected = ctx->head->field->type->name;
24489 PyErr_Format(PyExc_ValueError,
24490 "Buffer dtype mismatch, expected %s%s%s but got %s",
24491 quote, expected, quote,
24492 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
24494 __Pyx_StructField* field = ctx->head->field;
24495 __Pyx_StructField* parent = (ctx->head - 1)->field;
24496 PyErr_Format(PyExc_ValueError,
24497 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
24498 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
24499 parent->type->name, field->name);
24502 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
24504 size_t size, offset, arraysize = 1;
24505 if (ctx->enc_type == 0)
return 0;
24506 if (ctx->head->field->type->arraysize[0]) {
24508 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
24509 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
24511 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
24512 PyErr_Format(PyExc_ValueError,
24513 "Expected a dimension of size %zu, got %zu",
24514 ctx->head->field->type->arraysize[0], ctx->enc_count);
24518 if (!ctx->is_valid_array) {
24519 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
24520 ctx->head->field->type->ndim, ndim);
24523 for (i = 0; i < ctx->head->field->type->ndim; i++) {
24524 arraysize *= ctx->head->field->type->arraysize[i];
24526 ctx->is_valid_array = 0;
24527 ctx->enc_count = 1;
24529 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
24531 __Pyx_StructField* field = ctx->head->field;
24532 __Pyx_TypeInfo* type = field->type;
24533 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
24534 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
24536 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
24538 if (ctx->enc_packmode ==
'@') {
24539 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
24540 size_t align_mod_offset;
24541 if (align_at == 0)
return -1;
24542 align_mod_offset = ctx->fmt_offset % align_at;
24543 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
24544 if (ctx->struct_alignment == 0)
24545 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
24548 if (type->size != size || type->typegroup != group) {
24549 if (type->typegroup ==
'C' && type->fields != NULL) {
24550 size_t parent_offset = ctx->head->parent_offset + field->offset;
24552 ctx->head->field = type->fields;
24553 ctx->head->parent_offset = parent_offset;
24556 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
24558 __Pyx_BufFmt_RaiseExpected(ctx);
24562 offset = ctx->head->parent_offset + field->offset;
24563 if (ctx->fmt_offset != offset) {
24564 PyErr_Format(PyExc_ValueError,
24565 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
24566 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
24569 ctx->fmt_offset += size;
24571 ctx->fmt_offset += (arraysize - 1) * size;
24574 if (field == &ctx->root) {
24576 if (ctx->enc_count != 0) {
24577 __Pyx_BufFmt_RaiseExpected(ctx);
24582 ctx->head->field = ++field;
24583 if (field->type == NULL) {
24585 field = ctx->head->field;
24587 }
else if (field->type->typegroup ==
'S') {
24588 size_t parent_offset = ctx->head->parent_offset + field->offset;
24589 if (field->type->fields->type == NULL)
continue;
24590 field = field->type->fields;
24592 ctx->head->field = field;
24593 ctx->head->parent_offset = parent_offset;
24599 }
while (ctx->enc_count);
24601 ctx->is_complex = 0;
24605 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
24607 const char *ts = *tsp;
24608 int i = 0,
number, ndim;
24610 if (ctx->new_count != 1) {
24611 PyErr_SetString(PyExc_ValueError,
24612 "Cannot handle repeated arrays in format string");
24615 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24616 ndim = ctx->head->field->type->ndim;
24617 while (*ts && *ts !=
')') {
24619 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
24622 number = __Pyx_BufFmt_ExpectNumber(&ts);
24623 if (
number == -1)
return NULL;
24624 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
24625 return PyErr_Format(PyExc_ValueError,
24626 "Expected a dimension of size %zu, got %d",
24627 ctx->head->field->type->arraysize[i],
number);
24628 if (*ts !=
',' && *ts !=
')')
24629 return PyErr_Format(PyExc_ValueError,
24630 "Expected a comma in format string, got '%c'", *ts);
24631 if (*ts ==
',') ts++;
24635 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
24636 ctx->head->field->type->ndim, i);
24638 PyErr_SetString(PyExc_ValueError,
24639 "Unexpected end of format string, expected ')'");
24642 ctx->is_valid_array = 1;
24643 ctx->new_count = 1;
24647 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
24652 if (ctx->enc_type != 0 && ctx->head == NULL) {
24653 __Pyx_BufFmt_RaiseExpected(ctx);
24656 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24657 if (ctx->head != NULL) {
24658 __Pyx_BufFmt_RaiseExpected(ctx);
24668 if (!__Pyx_Is_Little_Endian()) {
24669 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
24672 ctx->new_packmode =
'=';
24677 if (__Pyx_Is_Little_Endian()) {
24678 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
24681 ctx->new_packmode =
'=';
24687 ctx->new_packmode = *ts++;
24691 const char* ts_after_sub;
24692 size_t i, struct_count = ctx->new_count;
24693 size_t struct_alignment = ctx->struct_alignment;
24694 ctx->new_count = 1;
24697 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
24700 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24702 ctx->enc_count = 0;
24703 ctx->struct_alignment = 0;
24706 for (i = 0; i != struct_count; ++i) {
24707 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
24708 if (!ts_after_sub)
return NULL;
24711 if (struct_alignment) ctx->struct_alignment = struct_alignment;
24716 size_t alignment = ctx->struct_alignment;
24718 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24720 if (alignment && ctx->fmt_offset % alignment) {
24721 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
24726 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24727 ctx->fmt_offset += ctx->new_count;
24728 ctx->new_count = 1;
24729 ctx->enc_count = 0;
24731 ctx->enc_packmode = ctx->new_packmode;
24737 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
24738 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
24741 CYTHON_FALLTHROUGH;
24742 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
24743 case 'l':
case 'L':
case 'q':
case 'Q':
24744 case 'f':
case 'd':
case 'g':
24745 case 'O':
case 'p':
24746 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
24747 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
24748 ctx->enc_count += ctx->new_count;
24749 ctx->new_count = 1;
24754 CYTHON_FALLTHROUGH;
24756 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24757 ctx->enc_count = ctx->new_count;
24758 ctx->enc_packmode = ctx->new_packmode;
24759 ctx->enc_type = *ts;
24760 ctx->is_complex = got_Z;
24762 ctx->new_count = 1;
24767 while(*ts !=
':') ++ts;
24771 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
24775 int number = __Pyx_BufFmt_ExpectNumber(&ts);
24776 if (
number == -1)
return NULL;
24777 ctx->new_count = (size_t)
number;
24784 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
24785 if (unlikely(info->buf == NULL))
return;
24786 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
24787 __Pyx_ReleaseBuffer(info);
24789 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
24792 buf->strides = __Pyx_zeros;
24793 buf->shape = __Pyx_zeros;
24794 buf->suboffsets = __Pyx_minusones;
24796 static int __Pyx__GetBufferAndValidate(
24797 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
24798 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
24801 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
24802 __Pyx_ZeroBuffer(buf);
24805 if (unlikely(buf->ndim != nd)) {
24806 PyErr_Format(PyExc_ValueError,
24807 "Buffer has wrong number of dimensions (expected %d, got %d)",
24812 __Pyx_BufFmt_Context ctx;
24813 __Pyx_BufFmt_Init(&ctx, stack, dtype);
24814 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
24816 if (unlikely((
size_t)buf->itemsize != dtype->size)) {
24817 PyErr_Format(PyExc_ValueError,
24818 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
24819 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
24820 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
24823 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
24826 __Pyx_SafeReleaseBuffer(buf);
24831 static void __Pyx_RaiseBufferIndexError(
int axis) {
24832 PyErr_Format(PyExc_IndexError,
24833 "Out of bounds on buffer access (axis %d)", axis);
24837 #if CYTHON_FAST_THREAD_STATE
24838 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24839 PyObject *tmp_type, *tmp_value, *tmp_tb;
24840 tmp_type = tstate->curexc_type;
24841 tmp_value = tstate->curexc_value;
24842 tmp_tb = tstate->curexc_traceback;
24843 tstate->curexc_type = type;
24844 tstate->curexc_value = value;
24845 tstate->curexc_traceback = tb;
24846 Py_XDECREF(tmp_type);
24847 Py_XDECREF(tmp_value);
24848 Py_XDECREF(tmp_tb);
24850 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24851 *type = tstate->curexc_type;
24852 *value = tstate->curexc_value;
24853 *tb = tstate->curexc_traceback;
24854 tstate->curexc_type = 0;
24855 tstate->curexc_value = 0;
24856 tstate->curexc_traceback = 0;
24861 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24862 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24864 value = PyDict_GetItemWithError(d, key);
24865 if (unlikely(!value)) {
24866 if (!PyErr_Occurred()) {
24867 if (unlikely(PyTuple_Check(key))) {
24868 PyObject* args = PyTuple_Pack(1, key);
24869 if (likely(args)) {
24870 PyErr_SetObject(PyExc_KeyError, args);
24874 PyErr_SetObject(PyExc_KeyError, key);
24885 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24887 if (!j)
return NULL;
24888 r = PyObject_GetItem(o, j);
24892 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24893 CYTHON_NCP_UNUSED
int wraparound,
24894 CYTHON_NCP_UNUSED
int boundscheck) {
24895 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24896 Py_ssize_t wrapped_i = i;
24897 if (wraparound & unlikely(i < 0)) {
24898 wrapped_i += PyList_GET_SIZE(o);
24900 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24901 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24905 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24907 return PySequence_GetItem(o, i);
24910 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24911 CYTHON_NCP_UNUSED
int wraparound,
24912 CYTHON_NCP_UNUSED
int boundscheck) {
24913 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24914 Py_ssize_t wrapped_i = i;
24915 if (wraparound & unlikely(i < 0)) {
24916 wrapped_i += PyTuple_GET_SIZE(o);
24918 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24919 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24923 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24925 return PySequence_GetItem(o, i);
24928 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24929 CYTHON_NCP_UNUSED
int wraparound,
24930 CYTHON_NCP_UNUSED
int boundscheck) {
24931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24932 if (is_list || PyList_CheckExact(o)) {
24933 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24934 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
24935 PyObject *
r = PyList_GET_ITEM(o,
n);
24940 else if (PyTuple_CheckExact(o)) {
24941 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24942 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
24943 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24948 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24949 if (likely(m && m->sq_item)) {
24950 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24951 Py_ssize_t l = m->sq_length(o);
24952 if (likely(l >= 0)) {
24955 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24960 return m->sq_item(o, i);
24964 if (is_list || PySequence_Check(o)) {
24965 return PySequence_GetItem(o, i);
24968 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24972 #if CYTHON_USE_TYPE_SLOTS
24973 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24975 Py_ssize_t key_value;
24976 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24977 if (unlikely(!(m && m->sq_item))) {
24978 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24981 key_value = __Pyx_PyIndex_AsSsize_t(index);
24982 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24983 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24985 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24987 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24991 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24992 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24993 if (likely(m && m->mp_subscript)) {
24994 return m->mp_subscript(obj, key);
24996 return __Pyx_PyObject_GetIndex(obj, key);
25001 #if !CYTHON_COMPILING_IN_PYPY
25002 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
25003 const double b = floatval;
25006 (void)zerodivision_check;
25007 if (likely(PyFloat_CheckExact(op1))) {
25008 a = PyFloat_AS_DOUBLE(op1);
25011 #if PY_MAJOR_VERSION < 3
25012 if (likely(PyInt_CheckExact(op1))) {
25013 a = (double) PyInt_AS_LONG(op1);
25017 if (likely(PyLong_CheckExact(op1))) {
25018 #if CYTHON_USE_PYLONG_INTERNALS
25019 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25020 const Py_ssize_t size = Py_SIZE(op1);
25022 case 0: a = 0.0;
break;
25023 case -1: a = -(double) digits[0];
break;
25024 case 1: a = (double) digits[0];
break;
25027 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
25028 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25029 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
25035 CYTHON_FALLTHROUGH;
25038 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
25039 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25040 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
25046 CYTHON_FALLTHROUGH;
25049 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
25050 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25051 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
25057 CYTHON_FALLTHROUGH;
25062 a = PyLong_AsDouble(op1);
25063 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
25067 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25070 PyFPE_START_PROTECT(
"add",
return NULL)
25072 PyFPE_END_PROTECT(result)
25073 return PyFloat_FromDouble(result);
25078 #if CYTHON_FAST_PYCALL
25079 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25080 PyObject *globals) {
25082 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25083 PyObject **fastlocals;
25086 assert(globals != NULL);
25091 assert(tstate != NULL);
25092 f = PyFrame_New(tstate, co, globals, NULL);
25096 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
25097 for (i = 0; i < na; i++) {
25099 fastlocals[i] = *args++;
25101 result = PyEval_EvalFrameEx(
f,0);
25102 ++tstate->recursion_depth;
25104 --tstate->recursion_depth;
25107 #if 1 || PY_VERSION_HEX < 0x030600B1
25108 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
25109 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25110 PyObject *globals = PyFunction_GET_GLOBALS(func);
25111 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25113 #if PY_MAJOR_VERSION >= 3
25116 PyObject *kwtuple, **k;
25121 assert(kwargs == NULL || PyDict_Check(kwargs));
25122 nk = kwargs ? PyDict_Size(kwargs) : 0;
25123 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
25127 #
if PY_MAJOR_VERSION >= 3
25128 co->co_kwonlyargcount == 0 &&
25130 likely(kwargs == NULL || nk == 0) &&
25131 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25132 if (argdefs == NULL && co->co_argcount == nargs) {
25133 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25136 else if (nargs == 0 && argdefs != NULL
25137 && co->co_argcount == Py_SIZE(argdefs)) {
25140 args = &PyTuple_GET_ITEM(argdefs, 0);
25141 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25145 if (kwargs != NULL) {
25147 kwtuple = PyTuple_New(2 * nk);
25148 if (kwtuple == NULL) {
25152 k = &PyTuple_GET_ITEM(kwtuple, 0);
25154 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
25165 closure = PyFunction_GET_CLOSURE(func);
25166 #if PY_MAJOR_VERSION >= 3
25167 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25169 if (argdefs != NULL) {
25170 d = &PyTuple_GET_ITEM(argdefs, 0);
25171 nd = Py_SIZE(argdefs);
25177 #if PY_MAJOR_VERSION >= 3
25178 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25181 d, (
int)nd, kwdefs, closure);
25183 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25186 d, (
int)nd, closure);
25188 Py_XDECREF(kwtuple);
25190 Py_LeaveRecursiveCall();
25197 #if CYTHON_FAST_PYCCALL
25198 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25199 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25200 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25201 PyObject *
self = PyCFunction_GET_SELF(func);
25202 int flags = PyCFunction_GET_FLAGS(func);
25203 assert(PyCFunction_Check(func));
25204 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
25205 assert(nargs >= 0);
25206 assert(nargs == 0 || args != NULL);
25210 assert(!PyErr_Occurred());
25211 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
25212 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
25214 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
25220 #if CYTHON_COMPILING_IN_CPYTHON
25221 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25223 ternaryfunc call = func->ob_type->tp_call;
25224 if (unlikely(!call))
25225 return PyObject_Call(func, arg, kw);
25226 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25228 result = (*call)(func, arg, kw);
25229 Py_LeaveRecursiveCall();
25230 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25233 "NULL result without error in PyObject_Call");
25240 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25241 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25242 PyObject *dict = Py_TYPE(obj)->tp_dict;
25243 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25245 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25246 PyObject **dictptr = NULL;
25247 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25249 #if CYTHON_COMPILING_IN_CPYTHON
25250 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
25252 dictptr = _PyObject_GetDictPtr(obj);
25255 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25257 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25258 PyObject *dict = Py_TYPE(obj)->tp_dict;
25259 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25261 return obj_dict_version == __Pyx_get_object_dict_version(obj);
25266 #if CYTHON_USE_DICT_VERSIONS
25267 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25269 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25273 #if !CYTHON_AVOID_BORROWED_REFS
25274 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25275 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25276 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25277 if (likely(result)) {
25278 return __Pyx_NewRef(result);
25279 }
else if (unlikely(PyErr_Occurred())) {
25283 result = PyDict_GetItem(__pyx_d, name);
25284 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25285 if (likely(result)) {
25286 return __Pyx_NewRef(result);
25290 result = PyObject_GetItem(__pyx_d, name);
25291 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25292 if (likely(result)) {
25293 return __Pyx_NewRef(result);
25297 return __Pyx_GetBuiltinName(name);
25301 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25302 if (unlikely(!type)) {
25303 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25306 if (likely(__Pyx_TypeCheck(obj, type)))
25308 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25309 Py_TYPE(obj)->tp_name, type->tp_name);
25314 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
25315 PyObject *args, *result = NULL;
25316 #if CYTHON_FAST_PYCALL
25317 if (PyFunction_Check(
function)) {
25318 PyObject *args[2] = {arg1, arg2};
25319 return __Pyx_PyFunction_FastCall(
function, args, 2);
25322 #if CYTHON_FAST_PYCCALL
25323 if (__Pyx_PyFastCFunction_Check(
function)) {
25324 PyObject *args[2] = {arg1, arg2};
25325 return __Pyx_PyCFunction_FastCall(
function, args, 2);
25328 args = PyTuple_New(2);
25329 if (unlikely(!args))
goto done;
25331 PyTuple_SET_ITEM(args, 0, arg1);
25333 PyTuple_SET_ITEM(args, 1, arg2);
25334 Py_INCREF(
function);
25335 result = __Pyx_PyObject_Call(
function, args, NULL);
25337 Py_DECREF(
function);
25343 #if CYTHON_COMPILING_IN_CPYTHON
25344 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25345 PyObject *
self, *result;
25347 cfunc = PyCFunction_GET_FUNCTION(func);
25348 self = PyCFunction_GET_SELF(func);
25349 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25351 result = cfunc(
self, arg);
25352 Py_LeaveRecursiveCall();
25353 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25356 "NULL result without error in PyObject_Call");
25363 #if CYTHON_COMPILING_IN_CPYTHON
25364 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25366 PyObject *args = PyTuple_New(1);
25367 if (unlikely(!args))
return NULL;
25369 PyTuple_SET_ITEM(args, 0, arg);
25370 result = __Pyx_PyObject_Call(func, args, NULL);
25374 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25375 #if CYTHON_FAST_PYCALL
25376 if (PyFunction_Check(func)) {
25377 return __Pyx_PyFunction_FastCall(func, &arg, 1);
25380 if (likely(PyCFunction_Check(func))) {
25381 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25382 return __Pyx_PyObject_CallMethO(func, arg);
25383 #if CYTHON_FAST_PYCCALL
25384 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25385 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25389 return __Pyx__PyObject_CallOneArg(func, arg);
25392 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25394 PyObject *args = PyTuple_Pack(1, arg);
25395 if (unlikely(!args))
return NULL;
25396 result = __Pyx_PyObject_Call(func, args, NULL);
25403 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
25404 PyObject* float_value;
25405 #if !CYTHON_USE_TYPE_SLOTS
25406 float_value = PyNumber_Float(obj);
if ((0))
goto bad;
25408 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
25409 if (likely(nb) && likely(nb->nb_float)) {
25410 float_value = nb->nb_float(obj);
25411 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
25412 PyErr_Format(PyExc_TypeError,
25413 "__float__ returned non-float (type %.200s)",
25414 Py_TYPE(float_value)->tp_name);
25415 Py_DECREF(float_value);
25418 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
25419 #if PY_MAJOR_VERSION >= 3
25420 float_value = PyFloat_FromString(obj);
25422 float_value = PyFloat_FromString(obj, 0);
25425 PyObject* args = PyTuple_New(1);
25426 if (unlikely(!args))
goto bad;
25427 PyTuple_SET_ITEM(args, 0, obj);
25428 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
25429 PyTuple_SET_ITEM(args, 0, 0);
25433 if (likely(float_value)) {
25434 double value = PyFloat_AS_DOUBLE(float_value);
25435 Py_DECREF(float_value);
25443 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25444 PyErr_Format(PyExc_ValueError,
25445 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25449 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25450 PyErr_Format(PyExc_ValueError,
25451 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25452 index, (index == 1) ?
"" :
"s");
25456 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25457 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25461 #if PY_MAJOR_VERSION < 3
25462 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25463 CYTHON_UNUSED PyObject *cause) {
25464 __Pyx_PyThreadState_declare
25466 if (!value || value == Py_None)
25470 if (!tb || tb == Py_None)
25474 if (!PyTraceBack_Check(tb)) {
25475 PyErr_SetString(PyExc_TypeError,
25476 "raise: arg 3 must be a traceback or None");
25480 if (PyType_Check(type)) {
25481 #if CYTHON_COMPILING_IN_PYPY
25483 Py_INCREF(Py_None);
25487 PyErr_NormalizeException(&type, &value, &tb);
25490 PyErr_SetString(PyExc_TypeError,
25491 "instance exception may not have a separate value");
25495 type = (PyObject*) Py_TYPE(type);
25497 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25498 PyErr_SetString(PyExc_TypeError,
25499 "raise: exception class must be a subclass of BaseException");
25503 __Pyx_PyThreadState_assign
25504 __Pyx_ErrRestore(type, value, tb);
25513 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25514 PyObject* owned_instance = NULL;
25515 if (tb == Py_None) {
25517 }
else if (tb && !PyTraceBack_Check(tb)) {
25518 PyErr_SetString(PyExc_TypeError,
25519 "raise: arg 3 must be a traceback or None");
25522 if (value == Py_None)
25524 if (PyExceptionInstance_Check(type)) {
25526 PyErr_SetString(PyExc_TypeError,
25527 "instance exception may not have a separate value");
25531 type = (PyObject*) Py_TYPE(value);
25532 }
else if (PyExceptionClass_Check(type)) {
25533 PyObject *instance_class = NULL;
25534 if (value && PyExceptionInstance_Check(value)) {
25535 instance_class = (PyObject*) Py_TYPE(value);
25536 if (instance_class != type) {
25537 int is_subclass = PyObject_IsSubclass(instance_class, type);
25538 if (!is_subclass) {
25539 instance_class = NULL;
25540 }
else if (unlikely(is_subclass == -1)) {
25543 type = instance_class;
25547 if (!instance_class) {
25550 args = PyTuple_New(0);
25551 else if (PyTuple_Check(value)) {
25555 args = PyTuple_Pack(1, value);
25558 owned_instance = PyObject_Call(type, args, NULL);
25560 if (!owned_instance)
25562 value = owned_instance;
25563 if (!PyExceptionInstance_Check(value)) {
25564 PyErr_Format(PyExc_TypeError,
25565 "calling %R should have returned an instance of "
25566 "BaseException, not %R",
25567 type, Py_TYPE(value));
25572 PyErr_SetString(PyExc_TypeError,
25573 "raise: exception class must be a subclass of BaseException");
25577 PyObject *fixed_cause;
25578 if (cause == Py_None) {
25579 fixed_cause = NULL;
25580 }
else if (PyExceptionClass_Check(cause)) {
25581 fixed_cause = PyObject_CallObject(cause, NULL);
25582 if (fixed_cause == NULL)
25584 }
else if (PyExceptionInstance_Check(cause)) {
25585 fixed_cause = cause;
25586 Py_INCREF(fixed_cause);
25588 PyErr_SetString(PyExc_TypeError,
25589 "exception causes must derive from "
25593 PyException_SetCause(value, fixed_cause);
25595 PyErr_SetObject(type, value);
25597 #if CYTHON_COMPILING_IN_PYPY
25598 PyObject *tmp_type, *tmp_value, *tmp_tb;
25599 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25601 PyErr_Restore(tmp_type, tmp_value, tb);
25602 Py_XDECREF(tmp_tb);
25604 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25605 PyObject* tmp_tb = tstate->curexc_traceback;
25606 if (tb != tmp_tb) {
25608 tstate->curexc_traceback = tb;
25609 Py_XDECREF(tmp_tb);
25614 Py_XDECREF(owned_instance);
25620 #if CYTHON_USE_EXC_INFO_STACK
25621 static _PyErr_StackItem *
25622 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25624 _PyErr_StackItem *exc_info = tstate->exc_info;
25625 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25626 exc_info->previous_item != NULL)
25628 exc_info = exc_info->previous_item;
25635 #if CYTHON_FAST_THREAD_STATE
25636 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25637 #if CYTHON_USE_EXC_INFO_STACK
25638 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25639 *type = exc_info->exc_type;
25640 *value = exc_info->exc_value;
25641 *tb = exc_info->exc_traceback;
25643 *type = tstate->exc_type;
25644 *value = tstate->exc_value;
25645 *tb = tstate->exc_traceback;
25648 Py_XINCREF(*value);
25651 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25652 PyObject *tmp_type, *tmp_value, *tmp_tb;
25653 #if CYTHON_USE_EXC_INFO_STACK
25654 _PyErr_StackItem *exc_info = tstate->exc_info;
25655 tmp_type = exc_info->exc_type;
25656 tmp_value = exc_info->exc_value;
25657 tmp_tb = exc_info->exc_traceback;
25658 exc_info->exc_type = type;
25659 exc_info->exc_value = value;
25660 exc_info->exc_traceback = tb;
25662 tmp_type = tstate->exc_type;
25663 tmp_value = tstate->exc_value;
25664 tmp_tb = tstate->exc_traceback;
25665 tstate->exc_type = type;
25666 tstate->exc_value = value;
25667 tstate->exc_traceback = tb;
25669 Py_XDECREF(tmp_type);
25670 Py_XDECREF(tmp_value);
25671 Py_XDECREF(tmp_tb);
25676 #if CYTHON_FAST_THREAD_STATE
25677 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25679 n = PyTuple_GET_SIZE(tuple);
25680 #if PY_MAJOR_VERSION >= 3
25681 for (i=0; i<
n; i++) {
25682 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25685 for (i=0; i<
n; i++) {
25686 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
25690 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25691 PyObject *exc_type = tstate->curexc_type;
25692 if (exc_type == err)
return 1;
25693 if (unlikely(!exc_type))
return 0;
25694 if (unlikely(PyTuple_Check(err)))
25695 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25696 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25701 #if CYTHON_FAST_THREAD_STATE
25702 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25704 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25707 PyObject *local_type, *local_value, *local_tb;
25708 #if CYTHON_FAST_THREAD_STATE
25709 PyObject *tmp_type, *tmp_value, *tmp_tb;
25710 local_type = tstate->curexc_type;
25711 local_value = tstate->curexc_value;
25712 local_tb = tstate->curexc_traceback;
25713 tstate->curexc_type = 0;
25714 tstate->curexc_value = 0;
25715 tstate->curexc_traceback = 0;
25717 PyErr_Fetch(&local_type, &local_value, &local_tb);
25719 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25720 #if CYTHON_FAST_THREAD_STATE
25721 if (unlikely(tstate->curexc_type))
25723 if (unlikely(PyErr_Occurred()))
25726 #if PY_MAJOR_VERSION >= 3
25728 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25732 Py_XINCREF(local_tb);
25733 Py_XINCREF(local_type);
25734 Py_XINCREF(local_value);
25735 *type = local_type;
25736 *value = local_value;
25738 #if CYTHON_FAST_THREAD_STATE
25739 #if CYTHON_USE_EXC_INFO_STACK
25741 _PyErr_StackItem *exc_info = tstate->exc_info;
25742 tmp_type = exc_info->exc_type;
25743 tmp_value = exc_info->exc_value;
25744 tmp_tb = exc_info->exc_traceback;
25745 exc_info->exc_type = local_type;
25746 exc_info->exc_value = local_value;
25747 exc_info->exc_traceback = local_tb;
25750 tmp_type = tstate->exc_type;
25751 tmp_value = tstate->exc_value;
25752 tmp_tb = tstate->exc_traceback;
25753 tstate->exc_type = local_type;
25754 tstate->exc_value = local_value;
25755 tstate->exc_traceback = local_tb;
25757 Py_XDECREF(tmp_type);
25758 Py_XDECREF(tmp_value);
25759 Py_XDECREF(tmp_tb);
25761 PyErr_SetExcInfo(local_type, local_value, local_tb);
25768 Py_XDECREF(local_type);
25769 Py_XDECREF(local_value);
25770 Py_XDECREF(local_tb);
25775 #ifndef __PYX_HAVE_RT_ImportType
25776 #define __PYX_HAVE_RT_ImportType
25777 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25778 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25780 PyObject *result = 0;
25782 Py_ssize_t basicsize;
25783 #ifdef Py_LIMITED_API
25784 PyObject *py_basicsize;
25786 result = PyObject_GetAttrString(module, class_name);
25789 if (!PyType_Check(result)) {
25790 PyErr_Format(PyExc_TypeError,
25791 "%.200s.%.200s is not a type object",
25792 module_name, class_name);
25795 #ifndef Py_LIMITED_API
25796 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25798 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25801 basicsize = PyLong_AsSsize_t(py_basicsize);
25802 Py_DECREF(py_basicsize);
25804 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25807 if ((
size_t)basicsize < size) {
25808 PyErr_Format(PyExc_ValueError,
25809 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25810 "Expected %zd from C header, got %zd from PyObject",
25811 module_name, class_name, size, basicsize);
25814 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25815 PyErr_Format(PyExc_ValueError,
25816 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25817 "Expected %zd from C header, got %zd from PyObject",
25818 module_name, class_name, size, basicsize);
25821 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25822 PyOS_snprintf(warning,
sizeof(warning),
25823 "%s.%s size changed, may indicate binary incompatibility. "
25824 "Expected %zd from C header, got %zd from PyObject",
25825 module_name, class_name, size, basicsize);
25826 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25828 return (PyTypeObject *)result;
25830 Py_XDECREF(result);
25836 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25837 PyObject *empty_list = 0;
25838 PyObject *module = 0;
25839 PyObject *global_dict = 0;
25840 PyObject *empty_dict = 0;
25842 #if PY_MAJOR_VERSION < 3
25843 PyObject *py_import;
25844 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25851 empty_list = PyList_New(0);
25856 global_dict = PyModule_GetDict(__pyx_m);
25859 empty_dict = PyDict_New();
25863 #if PY_MAJOR_VERSION >= 3
25865 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25866 module = PyImport_ImportModuleLevelObject(
25867 name, global_dict, empty_dict, list, 1);
25869 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25878 #if PY_MAJOR_VERSION < 3
25879 PyObject *py_level = PyInt_FromLong(level);
25882 module = PyObject_CallFunctionObjArgs(py_import,
25883 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25884 Py_DECREF(py_level);
25886 module = PyImport_ImportModuleLevelObject(
25887 name, global_dict, empty_dict, list, level);
25892 #if PY_MAJOR_VERSION < 3
25893 Py_XDECREF(py_import);
25895 Py_XDECREF(empty_list);
25896 Py_XDECREF(empty_dict);
25901 #ifndef CYTHON_CLINE_IN_TRACEBACK
25902 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
25903 PyObject *use_cline;
25904 PyObject *ptype, *pvalue, *ptraceback;
25905 #if CYTHON_COMPILING_IN_CPYTHON
25906 PyObject **cython_runtime_dict;
25908 if (unlikely(!__pyx_cython_runtime)) {
25911 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25912 #if CYTHON_COMPILING_IN_CPYTHON
25913 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25914 if (likely(cython_runtime_dict)) {
25915 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25916 use_cline, *cython_runtime_dict,
25917 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25921 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25922 if (use_cline_obj) {
25923 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25924 Py_DECREF(use_cline_obj);
25932 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25934 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25937 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25943 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25944 int start = 0, mid = 0, end = count - 1;
25945 if (end >= 0 && code_line > entries[end].code_line) {
25948 while (start < end) {
25949 mid = start + (end - start) / 2;
25950 if (code_line < entries[mid].code_line) {
25952 }
else if (code_line > entries[mid].code_line) {
25958 if (code_line <= entries[mid].code_line) {
25964 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25965 PyCodeObject* code_object;
25967 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25970 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25971 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
25974 code_object = __pyx_code_cache.entries[
pos].code_object;
25975 Py_INCREF(code_object);
25976 return code_object;
25978 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25980 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25981 if (unlikely(!code_line)) {
25984 if (unlikely(!entries)) {
25985 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25986 if (likely(entries)) {
25987 __pyx_code_cache.entries = entries;
25988 __pyx_code_cache.max_count = 64;
25989 __pyx_code_cache.count = 1;
25990 entries[0].code_line = code_line;
25991 entries[0].code_object = code_object;
25992 Py_INCREF(code_object);
25996 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25997 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
25998 PyCodeObject* tmp = entries[
pos].code_object;
25999 entries[
pos].code_object = code_object;
26003 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26004 int new_max = __pyx_code_cache.max_count + 64;
26005 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26006 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26007 if (unlikely(!entries)) {
26010 __pyx_code_cache.entries = entries;
26011 __pyx_code_cache.max_count = new_max;
26013 for (i=__pyx_code_cache.count; i>
pos; i--) {
26014 entries[i] = entries[i-1];
26016 entries[
pos].code_line = code_line;
26017 entries[
pos].code_object = code_object;
26018 __pyx_code_cache.count++;
26019 Py_INCREF(code_object);
26023 #include "compile.h"
26024 #include "frameobject.h"
26025 #include "traceback.h"
26026 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26027 const char *funcname,
int c_line,
26028 int py_line,
const char *filename) {
26029 PyCodeObject *py_code = 0;
26030 PyObject *py_srcfile = 0;
26031 PyObject *py_funcname = 0;
26032 #if PY_MAJOR_VERSION < 3
26033 py_srcfile = PyString_FromString(filename);
26035 py_srcfile = PyUnicode_FromString(filename);
26037 if (!py_srcfile)
goto bad;
26039 #if PY_MAJOR_VERSION < 3
26040 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26042 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26046 #if PY_MAJOR_VERSION < 3
26047 py_funcname = PyString_FromString(funcname);
26049 py_funcname = PyUnicode_FromString(funcname);
26052 if (!py_funcname)
goto bad;
26053 py_code = __Pyx_PyCode_New(
26070 Py_DECREF(py_srcfile);
26071 Py_DECREF(py_funcname);
26074 Py_XDECREF(py_srcfile);
26075 Py_XDECREF(py_funcname);
26078 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26079 int py_line,
const char *filename) {
26080 PyCodeObject *py_code = 0;
26081 PyFrameObject *py_frame = 0;
26082 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26084 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26086 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26088 py_code = __Pyx_CreateCodeObjectForTraceback(
26089 funcname, c_line, py_line, filename);
26090 if (!py_code)
goto bad;
26091 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26093 py_frame = PyFrame_New(
26099 if (!py_frame)
goto bad;
26100 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26101 PyTraceBack_Here(py_frame);
26103 Py_XDECREF(py_code);
26104 Py_XDECREF(py_frame);
26107 #if PY_MAJOR_VERSION < 3
26108 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26109 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26110 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26113 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26114 PyObject *obj = view->obj;
26116 if (PyObject_CheckBuffer(obj)) {
26117 PyBuffer_Release(view);
26128 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26129 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26130 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26131 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26132 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26134 func_type value = func_value;\
26135 if (sizeof(target_type) < sizeof(func_type)) {\
26136 if (unlikely(value != (func_type) (target_type) value)) {\
26137 func_type zero = 0;\
26138 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26139 return (target_type) -1;\
26140 if (is_unsigned && unlikely(value < zero))\
26141 goto raise_neg_overflow;\
26143 goto raise_overflow;\
26146 return (target_type) value;\
26150 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26151 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
26152 const int is_unsigned = neg_one > const_zero;
26154 if (
sizeof(
int) <
sizeof(long)) {
26155 return PyInt_FromLong((
long) value);
26156 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26157 return PyLong_FromUnsignedLong((
unsigned long) value);
26158 #ifdef HAVE_LONG_LONG
26159 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26160 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26164 if (
sizeof(
int) <=
sizeof(
long)) {
26165 return PyInt_FromLong((
long) value);
26166 #ifdef HAVE_LONG_LONG
26167 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26168 return PyLong_FromLongLong((PY_LONG_LONG) value);
26173 int one = 1;
int little = (int)*(
unsigned char *)&one;
26174 unsigned char *bytes = (
unsigned char *)&value;
26175 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26176 little, !is_unsigned);
26181 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
26182 const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
26183 const int is_unsigned = neg_one > const_zero;
26185 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26186 return PyInt_FromLong((
long) value);
26187 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26188 return PyLong_FromUnsignedLong((
unsigned long) value);
26189 #ifdef HAVE_LONG_LONG
26190 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26191 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26195 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
26196 return PyInt_FromLong((
long) value);
26197 #ifdef HAVE_LONG_LONG
26198 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26199 return PyLong_FromLongLong((PY_LONG_LONG) value);
26204 int one = 1;
int little = (int)*(
unsigned char *)&one;
26205 unsigned char *bytes = (
unsigned char *)&value;
26206 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
26207 little, !is_unsigned);
26212 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
26213 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
26214 const int is_unsigned = neg_one > const_zero;
26216 if (
sizeof(
long) <
sizeof(long)) {
26217 return PyInt_FromLong((
long) value);
26218 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26219 return PyLong_FromUnsignedLong((
unsigned long) value);
26220 #ifdef HAVE_LONG_LONG
26221 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26222 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26226 if (
sizeof(
long) <=
sizeof(
long)) {
26227 return PyInt_FromLong((
long) value);
26228 #ifdef HAVE_LONG_LONG
26229 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26230 return PyLong_FromLongLong((PY_LONG_LONG) value);
26235 int one = 1;
int little = (int)*(
unsigned char *)&one;
26236 unsigned char *bytes = (
unsigned char *)&value;
26237 return _PyLong_FromByteArray(bytes,
sizeof(
long),
26238 little, !is_unsigned);
26243 #if CYTHON_CCOMPLEX
26245 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26246 return ::std::complex< float >(x, y);
26249 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26250 return x + y*(__pyx_t_float_complex)_Complex_I;
26254 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26255 __pyx_t_float_complex
z;
26263 #if CYTHON_CCOMPLEX
26265 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26266 return (a.real == b.real) && (a.imag == b.imag);
26268 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26269 __pyx_t_float_complex
z;
26270 z.real = a.real + b.real;
26271 z.imag = a.imag + b.imag;
26274 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26275 __pyx_t_float_complex
z;
26276 z.real = a.real - b.real;
26277 z.imag = a.imag - b.imag;
26280 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26281 __pyx_t_float_complex
z;
26282 z.real = a.real * b.real - a.imag * b.imag;
26283 z.imag = a.real * b.imag + a.imag * b.real;
26287 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26289 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26290 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
26291 if (b.real == 0 && b.imag == 0) {
26292 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26294 float r = b.imag / b.real;
26295 float s = (float)(1.0) / (b.real + b.imag *
r);
26296 return __pyx_t_float_complex_from_parts(
26297 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26300 float r = b.real / b.imag;
26301 float s = (float)(1.0) / (b.imag + b.real *
r);
26302 return __pyx_t_float_complex_from_parts(
26303 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26307 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26309 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26311 float denom = b.real * b.real + b.imag * b.imag;
26312 return __pyx_t_float_complex_from_parts(
26313 (a.real * b.real + a.imag * b.imag) / denom,
26314 (a.imag * b.real - a.real * b.imag) / denom);
26318 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26319 __pyx_t_float_complex
z;
26324 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26325 return (a.real == 0) && (a.imag == 0);
26327 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26328 __pyx_t_float_complex
z;
26334 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
26335 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26336 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
26338 return hypotf(
z.real,
z.imag);
26341 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26342 __pyx_t_float_complex
z;
26343 float r, lnr, theta, z_r, z_theta;
26344 if (b.imag == 0 && b.real == (
int)b.real) {
26346 float denom = a.real * a.real + a.imag * a.imag;
26347 a.real = a.real / denom;
26348 a.imag = -a.imag / denom;
26351 switch ((
int)b.real) {
26359 return __Pyx_c_prod_float(a, a);
26361 z = __Pyx_c_prod_float(a, a);
26362 return __Pyx_c_prod_float(
z, a);
26364 z = __Pyx_c_prod_float(a, a);
26365 return __Pyx_c_prod_float(
z,
z);
26371 }
else if (b.imag == 0) {
26372 z.real = powf(a.real, b.real);
26375 }
else if (a.real > 0) {
26380 theta = atan2f(0.0, -1.0);
26383 r = __Pyx_c_abs_float(a);
26384 theta = atan2f(a.imag, a.real);
26387 z_r = expf(lnr * b.real - theta * b.imag);
26388 z_theta = theta * b.real + lnr * b.imag;
26389 z.real = z_r * cosf(z_theta);
26390 z.imag = z_r * sinf(z_theta);
26397 #if CYTHON_CCOMPLEX
26399 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26400 return ::std::complex< double >(x, y);
26403 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26404 return x + y*(__pyx_t_double_complex)_Complex_I;
26408 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26409 __pyx_t_double_complex
z;
26417 #if CYTHON_CCOMPLEX
26419 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26420 return (a.real == b.real) && (a.imag == b.imag);
26422 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26423 __pyx_t_double_complex
z;
26424 z.real = a.real + b.real;
26425 z.imag = a.imag + b.imag;
26428 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26429 __pyx_t_double_complex
z;
26430 z.real = a.real - b.real;
26431 z.imag = a.imag - b.imag;
26434 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26435 __pyx_t_double_complex
z;
26436 z.real = a.real * b.real - a.imag * b.imag;
26437 z.imag = a.real * b.imag + a.imag * b.real;
26441 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26443 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26444 }
else if (fabs(b.real) >= fabs(b.imag)) {
26445 if (b.real == 0 && b.imag == 0) {
26446 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26448 double r = b.imag / b.real;
26449 double s = (double)(1.0) / (b.real + b.imag *
r);
26450 return __pyx_t_double_complex_from_parts(
26451 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
26454 double r = b.real / b.imag;
26455 double s = (double)(1.0) / (b.imag + b.real *
r);
26456 return __pyx_t_double_complex_from_parts(
26457 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
26461 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26463 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26465 double denom = b.real * b.real + b.imag * b.imag;
26466 return __pyx_t_double_complex_from_parts(
26467 (a.real * b.real + a.imag * b.imag) / denom,
26468 (a.imag * b.real - a.real * b.imag) / denom);
26472 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26473 __pyx_t_double_complex
z;
26478 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26479 return (a.real == 0) && (a.imag == 0);
26481 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26482 __pyx_t_double_complex
z;
26488 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
26489 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26490 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
26492 return hypot(
z.real,
z.imag);
26495 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26496 __pyx_t_double_complex
z;
26497 double r, lnr, theta, z_r, z_theta;
26498 if (b.imag == 0 && b.real == (
int)b.real) {
26500 double denom = a.real * a.real + a.imag * a.imag;
26501 a.real = a.real / denom;
26502 a.imag = -a.imag / denom;
26505 switch ((
int)b.real) {
26513 return __Pyx_c_prod_double(a, a);
26515 z = __Pyx_c_prod_double(a, a);
26516 return __Pyx_c_prod_double(
z, a);
26518 z = __Pyx_c_prod_double(a, a);
26519 return __Pyx_c_prod_double(
z,
z);
26525 }
else if (b.imag == 0) {
26526 z.real = pow(a.real, b.real);
26529 }
else if (a.real > 0) {
26534 theta = atan2(0.0, -1.0);
26537 r = __Pyx_c_abs_double(a);
26538 theta = atan2(a.imag, a.real);
26541 z_r = exp(lnr * b.real - theta * b.imag);
26542 z_theta = theta * b.real + lnr * b.imag;
26543 z.real = z_r * cos(z_theta);
26544 z.imag = z_r * sin(z_theta);
26551 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
26552 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
26553 const int is_unsigned = neg_one > const_zero;
26555 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
26556 return PyInt_FromLong((
long) value);
26557 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
26558 return PyLong_FromUnsignedLong((
unsigned long) value);
26559 #ifdef HAVE_LONG_LONG
26560 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
26561 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26565 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
26566 return PyInt_FromLong((
long) value);
26567 #ifdef HAVE_LONG_LONG
26568 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
26569 return PyLong_FromLongLong((PY_LONG_LONG) value);
26574 int one = 1;
int little = (int)*(
unsigned char *)&one;
26575 unsigned char *bytes = (
unsigned char *)&value;
26576 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
26577 little, !is_unsigned);
26582 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
26583 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
26584 const int is_unsigned = neg_one > const_zero;
26585 #if PY_MAJOR_VERSION < 3
26586 if (likely(PyInt_Check(x))) {
26587 if (
sizeof(
int) <
sizeof(long)) {
26588 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
26590 long val = PyInt_AS_LONG(x);
26591 if (is_unsigned && unlikely(val < 0)) {
26592 goto raise_neg_overflow;
26598 if (likely(PyLong_Check(x))) {
26600 #if CYTHON_USE_PYLONG_INTERNALS
26601 const digit* digits = ((PyLongObject*)x)->ob_digit;
26602 switch (Py_SIZE(x)) {
26603 case 0:
return (
int) 0;
26604 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
26606 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26607 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26608 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26609 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
26610 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26615 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26616 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26617 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26618 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
26619 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26624 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26625 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26626 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26627 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
26628 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26634 #if CYTHON_COMPILING_IN_CPYTHON
26635 if (unlikely(Py_SIZE(x) < 0)) {
26636 goto raise_neg_overflow;
26640 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26641 if (unlikely(result < 0))
26643 if (unlikely(result == 1))
26644 goto raise_neg_overflow;
26647 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26648 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
26649 #ifdef HAVE_LONG_LONG
26650 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26651 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26655 #if CYTHON_USE_PYLONG_INTERNALS
26656 const digit* digits = ((PyLongObject*)x)->ob_digit;
26657 switch (Py_SIZE(x)) {
26658 case 0:
return (
int) 0;
26659 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
26660 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
26662 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
26663 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26664 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26665 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26666 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26671 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26672 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26673 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26674 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26675 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26680 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26681 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26682 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26683 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26684 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26689 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26690 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26691 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26692 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26693 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26698 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26699 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26700 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26701 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26702 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26707 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26708 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26709 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26710 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26711 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26717 if (
sizeof(
int) <=
sizeof(long)) {
26718 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
26719 #ifdef HAVE_LONG_LONG
26720 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26721 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
26726 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26727 PyErr_SetString(PyExc_RuntimeError,
26728 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26731 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26732 #if PY_MAJOR_VERSION < 3
26733 if (likely(
v) && !PyLong_Check(
v)) {
26735 v = PyNumber_Long(tmp);
26740 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26741 unsigned char *bytes = (
unsigned char *)&val;
26742 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26743 bytes,
sizeof(val),
26744 is_little, !is_unsigned);
26754 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26755 if (!tmp)
return (
int) -1;
26756 val = __Pyx_PyInt_As_int(tmp);
26761 PyErr_SetString(PyExc_OverflowError,
26762 "value too large to convert to int");
26764 raise_neg_overflow:
26765 PyErr_SetString(PyExc_OverflowError,
26766 "can't convert negative value to int");
26771 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
26772 const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
26773 const int is_unsigned = neg_one > const_zero;
26774 #if PY_MAJOR_VERSION < 3
26775 if (likely(PyInt_Check(x))) {
26776 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26777 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
26779 long val = PyInt_AS_LONG(x);
26780 if (is_unsigned && unlikely(val < 0)) {
26781 goto raise_neg_overflow;
26783 return (Py_intptr_t) val;
26787 if (likely(PyLong_Check(x))) {
26789 #if CYTHON_USE_PYLONG_INTERNALS
26790 const digit* digits = ((PyLongObject*)x)->ob_digit;
26791 switch (Py_SIZE(x)) {
26792 case 0:
return (Py_intptr_t) 0;
26793 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
26795 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26796 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26797 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26798 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
26799 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26804 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26805 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26806 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26807 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
26808 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26813 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26814 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26815 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26816 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
26817 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26823 #if CYTHON_COMPILING_IN_CPYTHON
26824 if (unlikely(Py_SIZE(x) < 0)) {
26825 goto raise_neg_overflow;
26829 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26830 if (unlikely(result < 0))
26831 return (Py_intptr_t) -1;
26832 if (unlikely(result == 1))
26833 goto raise_neg_overflow;
26836 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26837 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
26838 #ifdef HAVE_LONG_LONG
26839 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26840 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26844 #if CYTHON_USE_PYLONG_INTERNALS
26845 const digit* digits = ((PyLongObject*)x)->ob_digit;
26846 switch (Py_SIZE(x)) {
26847 case 0:
return (Py_intptr_t) 0;
26848 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
26849 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
26851 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
26852 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26853 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26854 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26855 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26860 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26861 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26862 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26863 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26864 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26869 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26870 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26871 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26872 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26873 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26878 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26879 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26880 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26881 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26882 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26887 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26888 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26889 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26890 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26891 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26896 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26897 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26898 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26899 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26900 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26906 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
26907 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
26908 #ifdef HAVE_LONG_LONG
26909 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26910 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
26915 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26916 PyErr_SetString(PyExc_RuntimeError,
26917 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26920 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
26921 #if PY_MAJOR_VERSION < 3
26922 if (likely(
v) && !PyLong_Check(
v)) {
26924 v = PyNumber_Long(tmp);
26929 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26930 unsigned char *bytes = (
unsigned char *)&val;
26931 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
26932 bytes,
sizeof(val),
26933 is_little, !is_unsigned);
26939 return (Py_intptr_t) -1;
26943 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26944 if (!tmp)
return (Py_intptr_t) -1;
26945 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
26950 PyErr_SetString(PyExc_OverflowError,
26951 "value too large to convert to Py_intptr_t");
26952 return (Py_intptr_t) -1;
26953 raise_neg_overflow:
26954 PyErr_SetString(PyExc_OverflowError,
26955 "can't convert negative value to Py_intptr_t");
26956 return (Py_intptr_t) -1;
26960 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
26961 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
26962 const int is_unsigned = neg_one > const_zero;
26963 #if PY_MAJOR_VERSION < 3
26964 if (likely(PyInt_Check(x))) {
26965 if (
sizeof(
long) <
sizeof(long)) {
26966 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
26968 long val = PyInt_AS_LONG(x);
26969 if (is_unsigned && unlikely(val < 0)) {
26970 goto raise_neg_overflow;
26976 if (likely(PyLong_Check(x))) {
26978 #if CYTHON_USE_PYLONG_INTERNALS
26979 const digit* digits = ((PyLongObject*)x)->ob_digit;
26980 switch (Py_SIZE(x)) {
26981 case 0:
return (
long) 0;
26982 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
26984 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26985 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26986 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26987 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
26988 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26993 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26994 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26995 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26996 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
26997 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27002 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27003 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27004 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27005 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27006 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27012 #if CYTHON_COMPILING_IN_CPYTHON
27013 if (unlikely(Py_SIZE(x) < 0)) {
27014 goto raise_neg_overflow;
27018 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27019 if (unlikely(result < 0))
27021 if (unlikely(result == 1))
27022 goto raise_neg_overflow;
27025 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27026 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27027 #ifdef HAVE_LONG_LONG
27028 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27029 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27033 #if CYTHON_USE_PYLONG_INTERNALS
27034 const digit* digits = ((PyLongObject*)x)->ob_digit;
27035 switch (Py_SIZE(x)) {
27036 case 0:
return (
long) 0;
27037 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27038 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27040 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27041 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27042 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27043 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27044 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27049 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27050 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27051 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27052 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27053 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27058 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27059 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27060 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27061 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27062 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27067 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27068 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27069 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27070 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27071 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27076 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27077 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27078 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27079 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27080 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27085 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27086 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27087 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27088 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27089 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27095 if (
sizeof(
long) <=
sizeof(long)) {
27096 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27097 #ifdef HAVE_LONG_LONG
27098 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27099 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27104 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27105 PyErr_SetString(PyExc_RuntimeError,
27106 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27109 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
27110 #if PY_MAJOR_VERSION < 3
27111 if (likely(
v) && !PyLong_Check(
v)) {
27113 v = PyNumber_Long(tmp);
27118 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27119 unsigned char *bytes = (
unsigned char *)&val;
27120 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
27121 bytes,
sizeof(val),
27122 is_little, !is_unsigned);
27132 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27133 if (!tmp)
return (
long) -1;
27134 val = __Pyx_PyInt_As_long(tmp);
27139 PyErr_SetString(PyExc_OverflowError,
27140 "value too large to convert to long");
27142 raise_neg_overflow:
27143 PyErr_SetString(PyExc_OverflowError,
27144 "can't convert negative value to long");
27149 #if CYTHON_COMPILING_IN_CPYTHON
27150 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
27156 return b == &PyBaseObject_Type;
27158 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
27160 if (a == b)
return 1;
27164 n = PyTuple_GET_SIZE(mro);
27165 for (i = 0; i <
n; i++) {
27166 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
27171 return __Pyx_InBases(a, b);
27173 #if PY_MAJOR_VERSION == 2
27174 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
27175 PyObject *exception, *value, *tb;
27177 __Pyx_PyThreadState_declare
27178 __Pyx_PyThreadState_assign
27179 __Pyx_ErrFetch(&exception, &value, &tb);
27180 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
27181 if (unlikely(res == -1)) {
27182 PyErr_WriteUnraisable(err);
27186 res = PyObject_IsSubclass(err, exc_type2);
27187 if (unlikely(res == -1)) {
27188 PyErr_WriteUnraisable(err);
27192 __Pyx_ErrRestore(exception, value, tb);
27196 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
27197 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
27199 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
27204 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
27206 assert(PyExceptionClass_Check(exc_type));
27207 n = PyTuple_GET_SIZE(tuple);
27208 #if PY_MAJOR_VERSION >= 3
27209 for (i=0; i<
n; i++) {
27210 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
27213 for (i=0; i<
n; i++) {
27214 PyObject *t = PyTuple_GET_ITEM(tuple, i);
27215 #if PY_MAJOR_VERSION < 3
27216 if (likely(exc_type == t))
return 1;
27218 if (likely(PyExceptionClass_Check(t))) {
27219 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
27225 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
27226 if (likely(err == exc_type))
return 1;
27227 if (likely(PyExceptionClass_Check(err))) {
27228 if (likely(PyExceptionClass_Check(exc_type))) {
27229 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
27230 }
else if (likely(PyTuple_Check(exc_type))) {
27231 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
27235 return PyErr_GivenExceptionMatches(err, exc_type);
27237 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
27238 assert(PyExceptionClass_Check(exc_type1));
27239 assert(PyExceptionClass_Check(exc_type2));
27240 if (likely(err == exc_type1 || err == exc_type2))
return 1;
27241 if (likely(PyExceptionClass_Check(err))) {
27242 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
27244 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
27249 static int __Pyx_check_binary_version(
void) {
27250 char ctversion[4], rtversion[4];
27251 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27252 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
27253 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27255 PyOS_snprintf(message,
sizeof(message),
27256 "compiletime version %s of module '%.100s' "
27257 "does not match runtime version %s",
27258 ctversion, __Pyx_MODULE_NAME, rtversion);
27259 return PyErr_WarnEx(NULL, message, 1);
27265 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27267 #if PY_MAJOR_VERSION < 3
27268 if (t->is_unicode) {
27269 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27270 }
else if (t->intern) {
27271 *t->p = PyString_InternFromString(t->s);
27273 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27276 if (t->is_unicode | t->is_str) {
27278 *t->p = PyUnicode_InternFromString(t->s);
27279 }
else if (t->encoding) {
27280 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27282 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27285 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27290 if (PyObject_Hash(*t->p) == -1)
27297 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
27298 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27300 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
27302 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27304 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27305 #if !CYTHON_PEP393_ENABLED
27306 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27308 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27309 if (!defenc)
return NULL;
27310 defenc_c = PyBytes_AS_STRING(defenc);
27311 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27313 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27315 for (
c = defenc_c;
c < end;
c++) {
27316 if ((
unsigned char) (*
c) >= 128) {
27317 PyUnicode_AsASCIIString(o);
27323 *length = PyBytes_GET_SIZE(defenc);
27327 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27328 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
27329 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27330 if (likely(PyUnicode_IS_ASCII(o))) {
27331 *length = PyUnicode_GET_LENGTH(o);
27332 return PyUnicode_AsUTF8(o);
27334 PyUnicode_AsASCIIString(o);
27338 return PyUnicode_AsUTF8AndSize(o, length);
27343 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27344 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27346 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27347 __Pyx_sys_getdefaultencoding_not_ascii &&
27349 PyUnicode_Check(o)) {
27350 return __Pyx_PyUnicode_AsStringAndSize(o, length);
27353 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27354 if (PyByteArray_Check(o)) {
27355 *length = PyByteArray_GET_SIZE(o);
27356 return PyByteArray_AS_STRING(o);
27361 int r = PyBytes_AsStringAndSize(o, &result, length);
27362 if (unlikely(
r < 0)) {
27369 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
27370 int is_true = x == Py_True;
27371 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
27372 else return PyObject_IsTrue(x);
27374 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27376 if (unlikely(!x))
return -1;
27377 retval = __Pyx_PyObject_IsTrue(x);
27381 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
27382 #if PY_MAJOR_VERSION >= 3
27383 if (PyLong_Check(result)) {
27384 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27385 "__int__ returned non-int (type %.200s). "
27386 "The ability to return an instance of a strict subclass of int "
27387 "is deprecated, and may be removed in a future version of Python.",
27388 Py_TYPE(result)->tp_name)) {
27395 PyErr_Format(PyExc_TypeError,
27396 "__%.4s__ returned non-%.4s (type %.200s)",
27397 type_name, type_name, Py_TYPE(result)->tp_name);
27401 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27402 #if CYTHON_USE_TYPE_SLOTS
27403 PyNumberMethods *m;
27405 const char *name = NULL;
27406 PyObject *res = NULL;
27407 #if PY_MAJOR_VERSION < 3
27408 if (likely(PyInt_Check(x) || PyLong_Check(x)))
27410 if (likely(PyLong_Check(x)))
27412 return __Pyx_NewRef(x);
27413 #if CYTHON_USE_TYPE_SLOTS
27414 m = Py_TYPE(x)->tp_as_number;
27415 #if PY_MAJOR_VERSION < 3
27416 if (m && m->nb_int) {
27418 res = m->nb_int(x);
27420 else if (m && m->nb_long) {
27422 res = m->nb_long(x);
27425 if (likely(m && m->nb_int)) {
27427 res = m->nb_int(x);
27431 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27432 res = PyNumber_Int(x);
27436 #if PY_MAJOR_VERSION < 3
27437 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27439 if (unlikely(!PyLong_CheckExact(res))) {
27441 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27444 else if (!PyErr_Occurred()) {
27445 PyErr_SetString(PyExc_TypeError,
27446 "an integer is required");
27450 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27453 #if PY_MAJOR_VERSION < 3
27454 if (likely(PyInt_CheckExact(b))) {
27455 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
27456 return PyInt_AS_LONG(b);
27458 return PyInt_AsSsize_t(b);
27461 if (likely(PyLong_CheckExact(b))) {
27462 #if CYTHON_USE_PYLONG_INTERNALS
27463 const digit* digits = ((PyLongObject*)b)->ob_digit;
27464 const Py_ssize_t size = Py_SIZE(b);
27465 if (likely(__Pyx_sst_abs(size) <= 1)) {
27466 ival = likely(size) ? digits[0] : 0;
27467 if (size == -1) ival = -ival;
27472 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27473 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27477 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27478 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27482 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27483 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27487 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27488 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27492 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27493 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27497 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27498 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27504 return PyLong_AsSsize_t(b);
27506 x = PyNumber_Index(b);
27508 ival = PyInt_AsSsize_t(x);
27512 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
27513 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27515 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
27516 return PyInt_FromSize_t(ival);